public void XOutsideValidBoxShouldThrowArgumentOutOfRangeException2() { ShapeStub sut = new ShapeStub(); sut.SetWidth(127990); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetX(11)); //allowed x values (given a certain width value) should not throw an exception sut.SetX(10); }
public void YOutsideValidBoxShouldThrowArgumentOutOfRangeException1() { ShapeStub sut = new ShapeStub(); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetY(-1)); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetY(1281)); //allowed y values (given a 0 value on height) should not throw an exception sut.SetY(0); sut.SetY(1280); }
public void XOutsideValidBoxShouldThrowArgumentOutOfRangeException1() { ShapeStub sut = new ShapeStub(); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetX(-1)); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetX(128001)); //allowed x values (given a 0 value on width) should not throw an exception sut.SetX(0); sut.SetX(128000); }
public void Expect_GetArea_ToReturn_ResultOfCalculateArea() { const double expected = 1; var sut = new ShapeStub(expected); var actual = sut.GetArea(); Assert.Equal(expected, actual); }
public void When_CalculateAreaReturnsNanOrInfinity_Expect_GetArea_ToThrow_InvalidOperationException(double calculateAreaResult) { var sut = new ShapeStub(calculateAreaResult); void Code() { var _ = sut.GetArea(); } Assert.Throws <InvalidOperationException>(Code); }
public void YOutsideValidBoxShouldThrowArgumentOutOfRangeException2() { ShapeStub sut = new ShapeStub(); sut.SetHeight(1270); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetY(11)); //allowed y values (given a certain height value) should not throw an exception sut.SetY(10); }
public void HeightOutsideValidBoxThrowsArgumentOutOfRangeException1() { ShapeStub sut = new ShapeStub(); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetHeight(-1)); Assert.Throws<ArgumentOutOfRangeException>(() => sut.SetHeight(1281)); //allowed height values (given a 0 value on y) should not throw an exception sut.SetHeight(0); sut.SetHeight(1280); }