示例#1
0
        public void should_fail_resolving_bl_graph_if_cannot_resolve_relations_1()
        {
            // Setup
            var graph = new BlGraph();

            graph.RegisterPawns(new BlsPawn[] { new InvalidParent1(), new InvalidChild1() });

            // Act & Assert
            Assert.Throws <DuplicateRelationInPawnError>(() => { graph.CompileGraph(); });
        }
示例#2
0
        public void should_resolve_law_firm_model_when_graph_is_compiled_1()
        {
            // Setup
            var graph = new BlGraph();

            graph.RegisterPawns(new BlsPawn[]
            {
                new LawFirm(), new Lawyer(), new Assistant(), new Matter(), new Client()
            });

            // Act
            graph.CompileGraph();

            // Assert
            Assert.NotEmpty(graph.CompiledCollections);
            Assert.NotEmpty(graph.CompiledRelations);
        }
示例#3
0
        public void should_resolve_law_firm_model_when_graph_is_compiled_2()
        {
            // Setup
            var graph = new BlGraph();

            graph.RegisterPawns(new BlsPawn[]
            {
                new Car(), new Wheel()
            });

            // Act
            graph.CompileGraph();

            // Assert
            Assert.NotEmpty(graph.CompiledCollections);
            Assert.NotEmpty(graph.CompiledRelations);
        }
示例#4
0
        BlGraph BuildGraph()
        {
            var graph = new BlGraph();

            graph.RegisterPawns(new BlsPawn[]
            {
                new Client(),
                new PawnWithTwoSoftDeleteFlags(),
                new PawnWithFtsOnNonStringProp(),
                new PawnWithStringPropAndNumericRestriction(),
                new PawnWithStringPropAndDateRestriction(),
                new PawnWithIntPropAndStringRestriction(),
                new PawnWithFloatPropAndStringRestriction(),
                new PawnWithCollectionPropAndNumericRestriction()
            });
            return(graph);
        }