Example #1
0
func TestCalculatesDiameter(t *testing.T) {
	wheel := gear1.NewWheel(26, 1.5)
	if wheel.Diameter() < 28.99 || wheel.Diameter() > 29.01 {
		t.Errorf("Expected diameter %f to be 29", wheel.Diameter())
	}
}
Example #2
0
func (s *MySuite) TestCalculatesDiameter(c *C) {
	wheel := gear1.NewWheel(26, 1.5)
	c.Assert(wheel.Diameter(), Within, 0.01, 29.0)
}