Esempio n. 1
0
        public void GetSystemUnderTest_ConnectionStringInDefault_CorrectlyInitialized()
        {
            //Buiding object used during test
            var ctrXmlStubFactory = new Mock<ContainXml>();
            var ctrXml = ctrXmlStubFactory.Object;

            var sutXml = new StructureXml();

            sutXml.Item = new MeasureGroupsXml();
            ((MeasureGroupsXml)sutXml.Item).Perspective = "Perspective";

            sutXml.Default = new DefaultXml() { ConnectionString = "connectionString-default" };

            var builder = new StructureContainBuilder();
            builder.Setup(sutXml, ctrXml);
            //Call the method to test
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            //Assertion
            Assert.That(sut, Is.InstanceOf<MetadataDiscoveryRequest>());
            Assert.That(((MetadataDiscoveryRequest)sut).ConnectionString, Is.EqualTo("connectionString-default"));
        }
Esempio n. 2
0
        public void GetSystemUnderTest_InCorrectMeasureGroupTargetWithoutCaption_Success()
        {
            //Buiding object used during test
            var ctrXmlStubFactory = new Mock<ContainXml>();
            var ctrXml = ctrXmlStubFactory.Object;

            var sutXml = new StructureXml();
            sutXml.Item = new MeasureGroupsXml();
            sutXml.Item.ConnectionString = "ConnectionString";
            ((MeasureGroupsXml)sutXml.Item).Perspective = "Perspective";
            var builder = new StructureContainBuilder();
            builder.Setup(sutXml, ctrXml);
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            //Assertion
            Assert.That(sut, Is.InstanceOf<MetadataDiscoveryRequest>());
        }
Esempio n. 3
0
        public void GetSystemUnderTest_CorrectPropertyTarget_Success()
        {
            //Buiding object used during test
            var ctrXmlStubFactory = new Mock<ContainXml>();
            var ctrXml = ctrXmlStubFactory.Object;

            var sutXml = new StructureXml();
            sutXml.Item = new PropertiesXml();
            sutXml.Item.ConnectionString = "ConnectionString";
            ((PropertiesXml)sutXml.Item).Perspective = "Perspective";
            ((PropertiesXml)sutXml.Item).Dimension = "Dimension";
            ((PropertiesXml)sutXml.Item).Hierarchy = "Hierarchy";
            ((PropertiesXml)sutXml.Item).Level = "Level";
            var builder = new StructureContainBuilder();
            builder.Setup(sutXml, ctrXml);
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            //Assertion
            Assert.That(sut, Is.InstanceOf<MetadataDiscoveryRequest>());
        }
Esempio n. 4
0
        public void GetSystemUnderTest_CorrectDimensionTarget_Success()
        {
            //Buiding object used during test
            var ctrXmlStubFactory = new Mock<ContainXml>();
            var ctrXml = ctrXmlStubFactory.Object;

            var sutXml = new StructureXml();
            var dim = new DimensionsXml();
            dim.ConnectionString = "ConnectionString";
            dim.Perspective = "Perspective";
            sutXml.Item = dim;

            var builder = new StructureContainBuilder();
            builder.Setup(sutXml, ctrXml);
            //Call the method to test
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            //Assertion
            Assert.That(sut, Is.InstanceOf<MetadataDiscoveryRequest>());
        }
        public void GetSystemUnderTest_ConnectionStringInDefault_CorrectlyInitialized()
        {
            //Buiding object used during test
            var ctrXmlStubFactory = new Mock<ContainXml>();
            var ctrXml = ctrXmlStubFactory.Object;

            var sutXml = new StructureXml();

            sutXml.Item = new MeasureGroupsXml();
            ((MeasureGroupsXml)sutXml.Item).Perspective = "Perspective";

            sutXml.Default = new DefaultXml() { ConnectionString = ConnectionStringReader.GetAdomd() };

            var builder = new StructureContainBuilder();
            builder.Setup(sutXml, ctrXml);
            //Call the method to test
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            //Assertion
            Assert.That(sut, Is.InstanceOf<OlapCommand>());
        }
        public void GetSystemUnderTest_CorrectPerspectiveTarget_Success()
        {
            //Buiding object used during test
            var ctrXmlStubFactory = new Mock<ContainXml>();
            var ctrXml = ctrXmlStubFactory.Object;

            var sutXml = new StructureXml();
            sutXml.Item = new PerspectivesXml();
            sutXml.Item.ConnectionString = ConnectionStringReader.GetAdomd();
            var builder = new StructureContainBuilder();
            builder.Setup(sutXml, ctrXml);
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            //Assertion
            Assert.That(sut, Is.InstanceOf<OlapCommand>());
        }