Beispiel #1
0
        public override void SetUp()
        {
            base.SetUp();

            _classDefinitionChecker    = new ClassDefinitionChecker();
            _endPointDefinitionChecker = new RelationEndPointDefinitionChecker();
        }
        public void Get_WithDuplicateAssembly()
        {
            var assembly = GetType().Assembly;
            var expectedMappingReflector    = MappingReflectorObjectMother.CreateMappingReflector(BaseConfiguration.GetTypeDiscoveryService(assembly));
            var expectedClassDefinitions    = expectedMappingReflector.GetClassDefinitions().ToDictionary(cd => cd.ClassType);
            var expectedRelationDefinitions = expectedMappingReflector.GetRelationDefinitions(expectedClassDefinitions);

            var mappingReflector       = MappingReflectorObjectMother.CreateMappingReflector(BaseConfiguration.GetTypeDiscoveryService(assembly, assembly));
            var actualClassDefinitions = mappingReflector.GetClassDefinitions().ToDictionary(cd => cd.ClassType);

            var classDefinitionChecker = new ClassDefinitionChecker();

            classDefinitionChecker.Check(expectedClassDefinitions.Values, actualClassDefinitions, false, false);

            var actualRelationDefinitions = mappingReflector.GetRelationDefinitions(actualClassDefinitions).ToDictionary(rd => rd.ID);
            var relationDefinitionChecker = new RelationDefinitionChecker();

            relationDefinitionChecker.Check(expectedRelationDefinitions, actualRelationDefinitions, false);
        }