Advertisement
Guest User

Untitled

a guest
May 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.84 KB | None | 0 0
  1. using System;
  2. using System.Linq.Expressions;
  3. using System.Threading.Tasks;
  4. using NSpecInNUnit;
  5.  
  6. namespace Row.NSpec {
  7.     public class FPSpec<T> : nspec_as_nunit<FPSpec<T>> {
  8.         public void BeforeAll(Action action) => beforeAll = action;
  9.         public void BeforeAllAsync(Func<Task> task) => beforeAllAsync = task;
  10.         public void Before(Action action) => before = action;
  11.         public void BeforeAsync(Func<Task> task) => beforeAsync = task;
  12.         public void BeforeEach(Action action) => beforeEach = action;
  13.         public void BeforeEachAsync(Func<Task> task) => beforeEachAsync = task;
  14.         public void It(string name, Action action) => it["it " + name] = action;
  15.         public void xIt(string name, Action action) => xit["it " + name] = action;
  16.         public void ItAsync(string name, Func<Task> task) => itAsync["it " + name] = task;
  17.         public void xItAsync(string name, Func<Task> task) => xitAsync["it " + name] = task;
  18.         public void Act(Action action) => act = action;
  19.         public void ActAsync(Func<Task> task) => actAsync = task;
  20.         public void After(Action action) => after = action;
  21.         public void AfterAsync(Func<Task> task) => afterAsync = task;
  22.         public void AfterEach(Action action) => afterEach = action;
  23.         public void AfterEachAsync(Func<Task> task) => afterEachAsync = task;
  24.         public void AfterAll(Action action) => afterAll = action;
  25.         public void AfterAllAsync(Func<Task> task) => afterAllAsync = task;
  26.         public void Specify(Expression<Action> action) => specify = action;
  27.         public void xSpecify(Expression<Action> action) => xspecify = action;
  28.         public void Context(string name, Action action) => context[name] = action;
  29.         public void xContext(string name, Action action) => xcontext[name] = action;
  30.         public void Describe(string name, Action action) => xdescribe[name] = action;
  31.         public void xDescribe(string name, Action action) => xdescribe[name] = action;
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement