Esempio n. 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(); });
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }