public void Instantiate_SqlConnection_GetDatabaseStructureDiscoveryFactory() { var connectionString = ConnectionStringReader.GetSqlClient(); var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(connectionString); Assert.That(factory, Is.TypeOf<RelationalStructureDiscoveryFactory>()); }
public void Matches_ActualEqualToExpectation_Success() { 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", "Channel Sales", "Direct Sales", "Finance", "Mined Customers", "Sales Summary", "Sales Targets" }; var ctr = new SubsetOfConstraint(expected); //Method under test Assert.That(discovery, ctr); }
public void ContainConstraint_FindExistingDimension_Success() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.Dimensions , TargetType.Object , new CaptionFilter[] {new CaptionFilter(Target.Perspectives, "Adventure Works")} ); var ctr = new ContainConstraint("Product"); //Method under test Assert.That(discovery, ctr); }
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); }
public void LinkedToConstraint_ExistingPerspectiveDimensionAndNotExistingMeasureGroup_Failure() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.MeasureGroups , TargetType.Relation , new CaptionFilter[] { new CaptionFilter(Target.Perspectives, "Adventure Works") , new CaptionFilter(Target.Dimensions, "Customer") }); var ctr = new LinkedToConstraint("Not existing"); //Method under test Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); }); }
public void LinkedToConstraint_ExistingPerspectiveDimensionAndMeasureGroupLinked_Success() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.MeasureGroups , TargetType.Relation , new CaptionFilter[] { new CaptionFilter(Target.Perspectives, "Adventure Works") , new CaptionFilter(Target.Dimensions, "Customer") }); var ctr = new LinkedToConstraint("Internet Sales"); //Method under test Assert.That(discovery, ctr); }
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 SubsetOfConstraint(expected); //Method under test Assert.That(ctr.Matches(discovery), Is.False); }
internal StructureContainBuilder(StructureDiscoveryFactoryProvider provider) : base(provider) { }
public void ContainConstraint_FindExistingMeasureWithCaseNonMatching_Success() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.Measures , TargetType.Object , new CaptionFilter[] { new CaptionFilter(Target.Perspectives, "Adventure Works") , new CaptionFilter(Target.MeasureGroups, "Reseller Orders") }); var ctr = new ContainConstraint("Reseller Order Count".ToLower()); ctr = ctr.IgnoreCase; //Method under test Assert.That(discovery, ctr); }
public void Matches_ExpectedNotContainedInActual_Failure() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.Perspectives , TargetType.Object , new CaptionFilter[] { }); var ctr = new ContainConstraint("Not existing"); //Method under test Assert.That(ctr.Matches(discovery), Is.False); }
public void Matches_ExpectedContainedInActual_Success() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.Perspectives , TargetType.Object , new CaptionFilter[] { }); var ctr = new ContainConstraint("Adventure Works"); //Method under test Assert.That(discovery, ctr); }
internal StructureLinkedToBuilder(StructureDiscoveryFactoryProvider discoveryProvider) : base(discoveryProvider) { }
public void ContainConstraint_FindNonExistingLevel_Failure() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.Levels , TargetType.Object , new CaptionFilter[] { new CaptionFilter(Target.Perspectives, "Adventure Works") , new CaptionFilter(Target.Dimensions, "Product") , new CaptionFilter(Target.Hierarchies, "Customer Geography") }); var ctr = new ContainConstraint("Not existing"); //Method under test Assert.That(ctr.Matches(discovery), Is.False); }
internal StructureSubsetOfBuilder(StructureDiscoveryFactoryProvider provider) : base(provider) { }
public AbstractStructureBuilder() { discoveryProvider = new StructureDiscoveryFactoryProvider(); }
public void ContainConstraint_FindNonExistingMeasure_Failure() { var provider = new StructureDiscoveryFactoryProvider(); var factory = provider.Instantiate(ConnectionStringReader.GetAdomd()); var discovery = factory.Instantiate( Target.Measures , TargetType.Object , new CaptionFilter[] { new CaptionFilter(Target.Perspectives, "Adventure Works") , new CaptionFilter(Target.MeasureGroups, "Reseller Orders") }); var ctr = new ContainConstraint("Not existing"); //Method under test Assert.That(ctr.Matches(discovery), Is.False); }
internal AbstractStructureBuilder(StructureDiscoveryFactoryProvider discoveryProvider) { this.discoveryProvider = discoveryProvider; }
internal StructureExistsBuilder(StructureDiscoveryFactoryProvider discoveryProvider) : base(discoveryProvider) { }