public void RegisterHandler_NUnitStyle() { //given var app = new ExampleApp(); app.RegisterHandler(new MyHandler()); var result = new object(); //when var response = app.Invoke(new MyQuery { ReturnMe = result }); //then Assert.AreSame(result, response.Result); }
public void RegisterHandler_TestFirstStyle() { ExampleApp app; Object result; MyQuery.Response response; Scenario() .Given(app = new ExampleApp()) .Given(() => app.RegisterHandler(new MyHandler())) .Given(result = new Object()) .When(response = app.Invoke(new MyQuery { ReturnMe = result })) .Then(ExpectThat(response), Is(AResponse.With().Result(result))); }