public void Matches_ActualEqualToExpectationButCaseNonMatching_Failure()
        {
            var provider  = new StructureDiscoveryFactoryProvider();
            var factory   = provider.Instantiate(ConnectionStringReader.GetAdomd());
            var discovery = factory.Instantiate(
                Target.Perspectives
                , TargetType.Object
                , new CaptionFilter[] { });

            var expected = new string[] { "Adventure Works".ToLower(), "Channel Sales".ToUpper(), "Direct Sales", "Finance", "Mined Customers", "Sales Summary", "Sales Targets" };
            var ctr      = new EquivalentToConstraint(expected);

            //Method under test
            Assert.That(ctr.Matches(discovery), Is.False);
        }
Beispiel #2
0
        public void Matches_ActualSubsetOfExpectation_Failure()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                ConnectionStringReader.GetAdomd()
                , DiscoveryTarget.Perspectives
                , new List <IFilter>());

            var expectedStrings = new string[] { "Adventure Works", "Channel Sales", "Direct Sales", "Finance", "Mined Customers", "Sales Summary", "Sales Targets" };
            var expected        = new List <string>();

            expected.AddRange(expectedStrings);
            expected.Add("New perspective");
            var ctr = new EquivalentToConstraint(expected);

            //Method under test
            Assert.That(ctr.Matches(discovery), Is.False);
        }
        public void Matches_ActualMoreThanExpectation_Failure()
        {
            var provider  = new StructureDiscoveryFactoryProvider();
            var factory   = provider.Instantiate(ConnectionStringReader.GetAdomd());
            var discovery = factory.Instantiate(
                Target.Perspectives
                , TargetType.Object
                , new CaptionFilter[] { });

            var expectedStrings = new string[] { "Adventure Works", "Channel Sales", "Direct Sales", "Finance", "Mined Customers", "Sales Summary", "Sales Targets" };
            var expected        = new List <string>();

            expected.AddRange(expectedStrings);
            expected.RemoveAt(0);
            var ctr = new EquivalentToConstraint(expected);

            //Method under test
            Assert.That(ctr.Matches(discovery), Is.False);
        }