public void EvaluateReturnsTrueIfConditionIsMatched() { var condition = new BuildConditionTaskCondition { BuildCondition = BuildCondition.ForceBuild }; var result = this.mocks.Create <IIntegrationResult>(MockBehavior.Strict).Object; Mock.Get(result).SetupGet(_result => _result.BuildCondition).Returns(BuildCondition.ForceBuild).Verifiable(); var actual = condition.Eval(result); this.mocks.VerifyAll(); Assert.IsTrue(actual); }
public void EvaluateReturnsFalseIfConditionIsNotMatched() { var condition = new BuildConditionTaskCondition { BuildCondition = BuildCondition.ForceBuild, Description = "Not equal test" }; var result = this.mocks.Create <IIntegrationResult>(MockBehavior.Strict).Object; Mock.Get(result).SetupGet(_result => _result.BuildCondition).Returns(BuildCondition.IfModificationExists).Verifiable(); var actual = condition.Eval(result); this.mocks.VerifyAll(); Assert.IsFalse(actual); }
public void EvaluateReturnsTrueIfConditionIsMatched() { var condition = new BuildConditionTaskCondition { BuildCondition = BuildCondition.ForceBuild }; var result = this.mocks.StrictMock <IIntegrationResult>(); Expect.Call(result.BuildCondition).Return(BuildCondition.ForceBuild); this.mocks.ReplayAll(); var actual = condition.Eval(result); this.mocks.VerifyAll(); Assert.IsTrue(actual); }
public void EvaluateReturnsFalseIfConditionIsNotMatched() { var condition = new BuildConditionTaskCondition { BuildCondition = BuildCondition.ForceBuild, Description = "Not equal test" }; var result = this.mocks.StrictMock <IIntegrationResult>(); Expect.Call(result.BuildCondition).Return(BuildCondition.IfModificationExists); this.mocks.ReplayAll(); var actual = condition.Eval(result); this.mocks.VerifyAll(); Assert.IsFalse(actual); }