public void EvaluateFailsIfTypeIsUnknown()
        {
            var condition = new CompareValuesTaskCondition
            {
                Value1         = "test1",
                Value2         = "test2",
                EvaluationType = (CompareValuesTaskCondition.Evaluation) 99
            };
            var result = this.mocks.Create <IIntegrationResult>(MockBehavior.Strict).Object;

            Assert.Throws <InvalidOperationException>(() => condition.Eval(result));

            this.mocks.VerifyAll();
        }
        public void EvaluateReturnsFalseIfValuesDontMatch()
        {
            var condition = new CompareValuesTaskCondition
            {
                Value1 = "test1",
                Value2 = "test2"
            };
            var result = this.mocks.Create <IIntegrationResult>(MockBehavior.Strict).Object;

            var actual = condition.Eval(result);

            this.mocks.VerifyAll();
            Assert.IsFalse(actual);
        }
Ejemplo n.º 3
0
        public void EvaluateReturnsTrueIfValuesMatch()
        {
            var condition = new CompareValuesTaskCondition
            {
                Value1 = "test",
                Value2 = "test"
            };
            var result = this.mocks.StrictMock <IIntegrationResult>();

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

            this.mocks.VerifyAll();
            Assert.IsTrue(actual);
        }
Ejemplo n.º 4
0
        public void EvaluateReturnsTrueIfValuesDontMatchAndTypeIsNotEqual()
        {
            var condition = new CompareValuesTaskCondition
            {
                Value1         = "test1",
                Value2         = "test2",
                EvaluationType = CompareValuesTaskCondition.Evaluation.NotEqual
            };
            var result = this.mocks.StrictMock <IIntegrationResult>();

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

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