コード例 #1
0
        public void ShouldFindSpecifications()
        {
            var location = new Uri(Assembly.GetAssembly(typeof(TestSpecificationWithBeforeAll)).CodeBase).LocalPath;
            var result   = finder.GetSpecifications(location);

            result.Specifications.Should().HaveCount(11);
        }
コード例 #2
0
        public IEnumerable <ExpressionResult> ExecuteSpecificationsInPath(string path, string example = null)
        {
            var result = finder.GetSpecifications(path, example);

            if (!result.FoundType)
            {
                foreach (var exampleText in example.SomeStringOrNone())
                {
                    foreach (var specification in FindSpecification(result.Specifications, exampleText))
                    {
                        return(ExecuteSpecifications(new [] { specification }, exampleText));
                    }

                    return(Enumerable.Empty <ExpressionResult>());
                }
            }

            return(ExecuteSpecifications(result.Specifications, example));
        }