public void WithTestDelegate_AndThrowConstraint_AndMessage_AndArg() { // Arrange var msg = MessageWithArg.CreateRandom(); // Pre-Assert // Act ShouldThrow(() => Expect(() => { throw new NotImplementedException(); }, Throws.Exception.InstanceOf <ArgumentException>(), msg.Message, msg.Arg), msg.Expected); ShouldNotThrow(() => Expect(() => { throw new ArgumentException(); }, Throws.Exception.InstanceOf <ArgumentException>(), msg.Message, msg.Arg)); // Assert }
public void WithFuncBool_AndMessage_AndArgs() { // Arrange var msg = MessageWithArg.CreateRandom(); // Pre-Assert // Act ShouldThrow(() => Expect(() => false, msg.Message, msg.Arg), msg.Expected); ShouldNotThrow(() => Expect(() => true, msg.Message, msg.Arg)); // Assert }
public void WithValueAndExpression_AndMessage_AndArgs() { // Arrange var msg = MessageWithArg.CreateRandom(); // Pre-Assert // Act ShouldThrow(() => Expect(true, Is.False, msg.Message, msg.Arg), msg.Expected); ShouldNotThrow(() => Expect(null, Is.Null, msg.Message, msg.Arg)); // Assert }
public void WithDelegate_AndConstraint_AndMessage_AndArg() { // Arrange var msg = MessageWithArg.CreateRandom(); var test = GetRandomInt(); // Pre-Assert // Act ShouldThrow(() => Expect(() => test, Is.Not.EqualTo(test), msg.Message, msg.Arg), msg.Expected); ShouldNotThrow(() => Expect(() => test, Is.EqualTo(test), msg.Message, msg.Arg)); // Assert }
public void WithBoolCondition_Message_Args() { // Arrange var msg = MessageWithArg.CreateRandom(); // Pre-Assert // Act ShouldThrow( () => Expect(false, msg.Message, msg.Arg), msg.Expected ); ShouldNotThrow( () => Expect(true, msg.Message, msg.Arg) ); // Assert }