Exemplo n.º 1
0
        public void CheckProductIdOfConstraintMatches(string identifier, short revision, bool expectedResult)
        {
            // Arrange
            var ident      = new ProductIdentity(identifier, revision);
            var constraint = ExpressionConstraint.Equals <IProcess>(p => ((IProductRecipe)p.Recipe).Product.Identity, ident);

            // Act Assert
            Assert.AreEqual(expectedResult, constraint.Check(CreateProcess()));
        }
Exemplo n.º 2
0
        public void ExpressionEquals(int foo, int compareValue)
        {
            // Arrange:
            var context = new DummyContext
            {
                Foo = foo
            };
            var constraint = ExpressionConstraint.Equals <DummyContext>(c => c.Foo, compareValue);

            // Act
            var result = constraint.Check(context);

            // Arrange
            Assert.AreEqual(result, foo == compareValue, "Constraint failed to compare objects");
        }