NSpec.Core.Runner.Run C# (CSharp) Method

Run() public method

public Run ( System.Action specifyExpectations, IExampleReporter exampleReporter ) : Example
specifyExpectations System.Action
exampleReporter IExampleReporter
return Example
        public Example Run(Action specifyExpectations, IExampleReporter exampleReporter)
        {
            var example = new Example();
            spec.SetUpAction = () => spec.Example = example;
            spec.TearDownAction = () => example.Run(exampleReporter);

            specifyExpectations();

            return example;
        }

Usage Example

Example #1
0
 internal static Example Execute(this Spec spec, Action specifyExpectations)
 {
     using (var runner = new Runner(spec))
         return runner.Run(() => {
             spec.SetUp();
             specifyExpectations();
             spec.TearDown();
         }, Substitute.For<IExampleReporter>());
 }
All Usage Examples Of NSpec.Core.Runner::Run