public void Should_calculate_circumference_for_rectangle() { Rectangle rect = new Rectangle(); rect.A = 3; rect.B = 4; Assert.That(rect.Circumference(), Is.EqualTo(14)); }
public void ShouldTotalCircumferenceCalculator_return_correct_sum() { IShape square = new Square { A = 4 }; IShape rect = new Rectangle { A = 4, B = 5 }; TotalCircumferenceCalculator calculator = new TotalCircumferenceCalculator(); calculator.Add(square); calculator.Add(rect); Assert.That(calculator.GetTotal(), Is.EqualTo(square.Circumference() + rect.Circumference())); }
int CalculateCircumferenceForRectangle(Rectangle rect) { rect.A = 4; rect.B = 5; return rect.Circumference(); }