コード例 #1
0
        /// <summary>
        /// Returns the first node in the graph that matches the specified predicate.
        /// If no node is present - fails with exception.
        /// </summary>
        internal static ISpecimenBuilderNode FindFirstNode(this ISpecimenBuilderNode graph, Func <ISpecimenBuilderNode, bool> predicate)
        {
            var result = graph.FindFirstNodeOrDefault(predicate);

            if (result == null)
            {
                throw new InvalidOperationException("Unable to find node matching the specified predicate.");
            }

            return(result);
        }
コード例 #2
0
ファイル: NodeComposer.cs プロジェクト: cmannix/AutoFixture
 private static ISpecimenBuilderNode FindAutoPropertiesNode(
     ISpecimenBuilderNode graph)
 {
     return(graph.FindFirstNodeOrDefault(IsAutoPropertyNode));
 }