Ejemplo n.º 1
0
        public void GetSystemUnderTest_ResultSetSystemXml_IResultSetService()
        {
            var sutXmlStub = new Mock <Systems.ResultSetSystemXml>();

            sutXmlStub.Setup(s => s.File.Path).Returns("myFile.csv");
            var sutXml = sutXmlStub.Object;

            var ctrXml = new SingleRowXml
            {
                Predication = new PredicationXml()
                {
                    Predicate = new MoreThanXml()
                    {
                        Value = "100"
                    },
                    Operand = new ColumnOrdinalIdentifier(0)
                }
            };

            var builder = new ResultSetSingleRowBuilder();

            builder.Setup(sutXml, ctrXml, null, null, new ServiceLocator());
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            Assert.That(sut, Is.Not.Null);
            Assert.That(sut, Is.InstanceOf <IResultSetService>());
        }
Ejemplo n.º 2
0
        public void GetSystemUnderTest_ExecutionXml_IResultSetService()
        {
            var sutXmlStubFactory  = new Mock <Systems.ExecutionXml>();
            var itemXmlStubFactory = new Mock <QueryableXml>();

            itemXmlStubFactory.Setup(i => i.GetQuery()).Returns("query");
            sutXmlStubFactory.Setup(s => s.Item).Returns(itemXmlStubFactory.Object);
            var sutXml = sutXmlStubFactory.Object;

            sutXml.Item = itemXmlStubFactory.Object;

            var ctrXml = new SingleRowXml
            {
                Predication = new PredicationXml()
                {
                    Predicate = new MoreThanXml()
                    {
                        Value = "100"
                    },
                    Operand = new ColumnOrdinalIdentifier(0)
                }
            };

            var builder = new ResultSetSingleRowBuilder();

            builder.Setup(sutXml, ctrXml, null, null, new ServiceLocator());
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            Assert.That(sut, Is.Not.Null);
            Assert.That(sut, Is.InstanceOf <IResultSetService>());
        }