public void EvaluateReturnsTrueIfConditionIsMatched()
        {
            var condition = new StatusTaskCondition
                {
                    Status = IntegrationStatus.Success
                };
            var result = this.mocks.Create<IIntegrationResult>(MockBehavior.Strict).Object;
            Mock.Get(result).SetupGet(_result => _result.Status).Returns(IntegrationStatus.Success).Verifiable();

            var actual = condition.Eval(result);

            this.mocks.VerifyAll();
            Assert.IsTrue(actual);
        }
예제 #2
0
        public void EvaluateReturnsTrueIfConditionIsMatched()
        {
            var condition = new StatusTaskCondition
            {
                Status = IntegrationStatus.Success
            };
            var result = this.mocks.StrictMock <IIntegrationResult>();

            Expect.Call(result.Status).Return(IntegrationStatus.Success);

            this.mocks.ReplayAll();
            var actual = condition.Eval(result);

            this.mocks.VerifyAll();
            Assert.IsTrue(actual);
        }
예제 #3
0
        public void EvaluateReturnsFalseIfConditionIsNotMatched()
        {
            var condition = new StatusTaskCondition
            {
                Status      = IntegrationStatus.Success,
                Description = "Not equal test"
            };
            var result = this.mocks.StrictMock <IIntegrationResult>();

            Expect.Call(result.Status).Return(IntegrationStatus.Failure);

            this.mocks.ReplayAll();
            var actual = condition.Eval(result);

            this.mocks.VerifyAll();
            Assert.IsFalse(actual);
        }