Esempio n. 1
0
        public void GetSystemUnderTest_Build_CorrectSystemUnderTest()
        {
            var sutXml = new StructureXml();
            var item   = new PerspectiveXml();

            sutXml.Item           = item;
            item.ConnectionString = ConnectionStringReader.GetAdomd();
            item.Caption          = "perspective";
            var ctrXml = new ExistsXml();

            var builder = new StructureExistsBuilder();

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

            Assert.That(sut, Is.InstanceOf <StructureDiscoveryCommand>());
        }
Esempio n. 2
0
        public void GetConstraint_Build_CorrectConstraint()
        {
            var sutXml = new StructureXml();
            var item   = new HierarchyXml();

            item.ConnectionString = ConnectionStringReader.GetAdomd();
            item.Perspective      = "perspective-name";
            item.Dimension        = "dimension-caption";
            item.Caption          = "hierarchy-caption";
            sutXml.Item           = item;
            var ctrXml = new ExistsXml();

            var builder = new StructureExistsBuilder();

            builder.Setup(sutXml, ctrXml);
            builder.Build();
            var ctr = builder.GetConstraint();

            Assert.That(ctr, Is.InstanceOf <ExistsConstraint>());
        }
Esempio n. 3
0
        public void GetConstraint_BuildWithoutIgnoreCase_ComparerCaseSensitive()
        {
            var sutXml = new StructureXml();
            var item   = new PerspectiveXml();

            sutXml.Item           = item;
            item.ConnectionString = ConnectionStringReader.GetAdomd();
            item.Caption          = "perspective";
            var ctrXml = new ExistsXml();

            var builder = new StructureExistsBuilder();

            builder.Setup(sutXml, ctrXml);
            builder.Build();
            var ctr = builder.GetConstraint();

            var existsCtr = (ExistsConstraint)ctr;

            Assert.That(existsCtr.Comparer, Is.InstanceOf <Comparer>());
            Assert.That(existsCtr.Comparer.Compare("c", "C"), Is.Not.EqualTo(0));
        }
Esempio n. 4
0
        public void GetConstraint_BuildWithIgnoreCase_ComparerCaseInsensitive()
        {
            var sutXml = new StructureXml();
            var item   = new PerspectiveXml();

            sutXml.Item           = item;
            item.ConnectionString = "connectionString";
            item.Caption          = "perspective";
            var ctrXml = new ExistsXml();

            ctrXml.IgnoreCase = true;

            var builder = new StructureExistsBuilder();

            builder.Setup(sutXml, ctrXml);
            builder.Build();
            var ctr = builder.GetConstraint();

            var existsCtr = (ExistsConstraint)ctr;

            Assert.That(existsCtr.Comparer, Is.InstanceOf <NBi.Core.Analysis.Metadata.Field.ComparerByCaption>());
            Assert.That(existsCtr.Comparer.Compare("c", "C"), Is.EqualTo(0));
        }