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); }
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); }
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); }