public void Shouldly_ShouldErrorIfCatchingExceptionOfWrongType() { var widget = new Widget(); TestHelpers.Should.Error( () => Should.Throw <ArgumentOutOfRangeException>(() => widget.Twist(-2)), "`widget.Twist(-2)` should throw System.ArgumentOutOfRangeException but threw System.InvalidOperationException"); }
public void Shouldly_ShouldErrorIfNoExceptionWasThrown() { var widget = new Widget(); TestHelpers.Should.Error( () => Should.Throw <ArgumentOutOfRangeException>(() => widget.Twist(5)), "`widget.Twist(5)` should throw System.ArgumentOutOfRangeException but did not"); }
public void Shouldly_ShouldThrowException() { var widget = new Widget(); Should.Throw <ArgumentOutOfRangeException>(() => widget.Twist(-1)); }
public void Shouldly_ShouldNotThrowException() { var widget = new Widget(); Should.NotThrow(() => widget.Twist(5)); }
public void Shouldly_ShouldThrowException() { var widget = new Widget(); Should.Throw<ArgumentOutOfRangeException>(() => widget.Twist(-1)); }
public void Shouldly_ShouldErrorIfNoExceptionWasThrown() { var widget = new Widget(); TestHelpers.Should.Error( () => Should.Throw<ArgumentOutOfRangeException>(() => widget.Twist(5)), "`widget.Twist(5)` should throw System.ArgumentOutOfRangeException but did not"); }
public void Shouldly_ShouldErrorIfCatchingExceptionOfWrongType() { var widget = new Widget(); TestHelpers.Should.Error( () => Should.Throw<ArgumentOutOfRangeException>(() => widget.Twist(-2)), "`widget.Twist(-2)` should throw System.ArgumentOutOfRangeException but threw System.InvalidOperationException"); }