예제 #1
0
        public void Matches_IsFailure_False()
        {
            var stub = new Mock <IExecutable>();

            stub.Setup(e => e.Execute())
            .Returns(Mock.Of <IExecutionResult>(r => r.IsSuccess == false));
            var engine = stub.Object;

            var successfulConstraint = new SuccessfulConstraint();

            Assert.That(successfulConstraint.Matches(engine), Is.False);
        }
예제 #2
0
        public void Matches_IsSuccessful_True()
        {
            var stub = new Mock <IExecution>();

            stub.Setup(e => e.Run())
            .Returns(Mock.Of <IExecutionResult>(r => r.IsSuccess == true));
            var engine = stub.Object;

            var successfulConstraint = new SuccessfulConstraint();

            Assert.That(successfulConstraint.Matches(engine), Is.True);
        }