/// <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);
        }
Example #2
0
 private static ISpecimenBuilderNode FindAutoPropertiesNode(
     ISpecimenBuilderNode graph)
 {
     return(graph.FindFirstNodeOrDefault(IsAutoPropertyNode));
 }