Exemplo n.º 1
0
        DependOnChain <TThisType, TAssertions>(
            this ReferenceTypeAssertions <TThisType, TAssertions> o,
            params object[] values)
            where TAssertions : ReferenceTypeAssertions <TThisType, TAssertions>
        {
            var objectTreePaths = new ObjectGraphPaths();

            new ObjectGraphNodeFactory(NoLogging, DefaultTerminalNodeConditions()).Root(o.Subject)
            .CollectPathsInto(objectTreePaths);
            objectTreePaths.AssertContainNonRootSubPath(values);
            return(new AndConstraint <ReferenceTypeAssertions <TThisType, TAssertions> >(o));
        }
Exemplo n.º 2
0
        public static AndConstraint <ObjectAssertions> DependOn <T>(this ObjectAssertions o,
                                                                    Func <DependsOnAssertionsOptions, DependsOnAssertionsOptions> optionsFunc)
        {
            var objectTreePaths            = new ObjectGraphPaths();
            var dependsOnAssertionsOptions = optionsFunc(new DependsOnAssertionsOptions());

            new ObjectGraphNodeFactory(NoLogging, dependsOnAssertionsOptions.TerminalNodeConditions)
            .Root(o.Subject)
            .CollectPathsInto(objectTreePaths);
            objectTreePaths.AssertContainNonRootObjectOf(typeof(T));
            return(new AndConstraint <ObjectAssertions>(o));
        }
Exemplo n.º 3
0
        public static AndConstraint <ReferenceTypeAssertions <TThisType, TAssertions> > DependOn <
            TAssertions, TDependency, TThisType>(
            this ReferenceTypeAssertions <TThisType, TAssertions> o,
            TDependency value)
            where TAssertions : ReferenceTypeAssertions <TThisType, TAssertions>
        {
            var objectTreePaths = new ObjectGraphPaths();

            new ObjectGraphNodeFactory(NoLogging, DefaultTerminalNodeConditions()).Root(o.Subject)
            .CollectPathsInto(objectTreePaths);
            objectTreePaths.AssertContainNonRoot(value);
            return(new AndConstraint <ReferenceTypeAssertions <TThisType, TAssertions> >(o));
        }