public void GetCurrentUserInfoShouldRaiseEvent()
        {
            var result = new ExpressionNodeExecuterStub(Mock.Create<INodeVisitor>());
            bool fired = false;
            ExpressionNodeExecuterBase.GetCurrentUserInfo += (sender, args) => { fired = true; };
            result.RaiseOnGetUserInfo();

            Assert.IsTrue(fired);
        }
        public void GetResultCollectionTest()
        {
            var result = new ExpressionNodeExecuterStub(Mock.Create<INodeVisitor>());
            var node = new DestinationNode();
            node.ResultNodes.Add(new ResultNode("Fieldl1", new ConstantNode(NodeDataType.Decimal, 0)));
            node.ResultNodes.Add(new ResultNode("Fieldl2", new ConstantNode(NodeDataType.Decimal, 0)));

            var results = result.GetResultCollectionPublic(node);

            Assert.AreEqual(2, results.Count);
        }
        public void ExtractValueForCurrentUserShouldReturnEventProvidedDataTest()
        {
            var executer = new ExpressionNodeExecuterStub(Mock.Create<INodeVisitor>());

            ExpressionNodeExecuterBase.GetCurrentUserInfo += (sender, args) =>
                {
                    args.UserInfoValues["Path"] = "Value";
                };

            var result = executer.ExtractValue(SourceFieldSetNames.CurrentUserInfo, "Path", null);

            Assert.AreEqual("Value", result);
        }
 public void CtorShouldRaiseExceptionIfNodeCompilerIsNull()
 {
     var result = new ExpressionNodeExecuterStub(null);
 }
 public void CtorTest()
 {
     var result = new ExpressionNodeExecuterStub(Mock.Create<INodeVisitor>());
     Assert.IsNotNull(result.NodeCompiler);
 }
        public void ExtractValueShouldReturnItemPropertyValue()
        {
            var executer = new ExpressionNodeExecuterStub(Mock.Create<INodeVisitor>());

            var data = new DummyData { Child = new DummyData { Value = "Value" } };

            var result = executer.ExtractValue(SourceFieldSetNames.Item, "Child.Value", data);

            Assert.AreEqual("Value", result);
        }
        public void ExtractValueShouldRaiseExceptionIfPathIsNull()
        {
            var executer = new ExpressionNodeExecuterStub(Mock.Create<INodeVisitor>());

            var result = executer.ExtractValue(SourceFieldSetNames.Item, null, null);
        }