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 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 static double CalculateArea(OldAndStupidRectangle shape) { return(shape.Area()); }