public void WhenTheEventIsReceivedItIsEvaluated(ClosureData eventData)
        {
            var target = new ClosureEvaluator();
            var view   = new Policy();

            target.Evaluate(view, null, eventData);

            Assert.Equal("Closed", view.PolicyStatus);
        }
Ejemplo n.º 2
0
        public void ClosureEvaluatorReplacesClosureVariablesWithTheirValue()
        {
            // Arrange
            int value = 2;
            var query = from i in new[] { 1, 2, 3 }.AsSafeQueryable()
                        where i > value
                        select i;

            Expression expression = new ClosureEvaluator(checkAssembly: false).Visit(query.Expression);
            // Assert
            Assert.Equal("System.Int32[].Where(i => (i > 2))", expression.ToString());
        }
Ejemplo n.º 3
0
        public void ClosureEvaluatorReplacesClosureVariablesWithTheirValue()
        {
            // Arrange
            int value = 2;
            var query = from i in new[] { 1, 2, 3 }.AsSafeQueryable()
            where i > value
            select i;

            Expression expression = new ClosureEvaluator(checkAssembly: false).Visit(query.Expression);

            // Assert
            Assert.AreEqual("System.Int32[].Where(i => (i > 2))", expression.ToString());
        }