public void ShouldCalculateCorectAreaFor(int lenght, int width, int expectedArea) { var shape = new OldAndStupidRectangle(lenght, width); var actualArea = ShapeAreaManager.CalculateArea(shape); Assert.AreEqual(expectedArea, actualArea); }
public void ShouldCalculateCorectAreaFor(double lenght, double width, double expectedArea) { var shape = new NewAndSmartRectangle(lenght, width); var actualArea = ShapeAreaManager.CalculateArea(shape); Assert.AreEqual(expectedArea, actualArea); }
public void ShouldHaveInvalidPostconditionsFor(int lenght, int width) { Assert.Throws <InvalidOperationException>(() => { var shape = new OldAndStupidRectangle(lenght, width); ShapeAreaManager.CalculateArea(shape); }, "Something is wrong!"); }
public void ShouldHaveInvalidPreconditionsFor(int lenght, int width) { Assert.Throws <Exception>(() => { var shape = new OldAndStupidRectangle(lenght, width); ShapeAreaManager.CalculateArea(shape); }); }
public void ShouldHaveInvalidPostconditionsFor(double lenght, double width) { Assert.Throws <InvalidOperationException>(() => { var shape = new NewAndSmartRectangle(lenght, width); ShapeAreaManager.CalculateArea(shape); }); }