public RegisterModule(Interactors interactors) { Get("/register", context => { var name = Request.Query["name"]; var phone = Request.Query["phone"]; var result = interactors.Register(name, phone); var json = FormatterExtensions.AsJson <Result>(Response, result); return(json); }); Get("/approve/{id}", context => { var id = context.id; var code = Request.Query["code"]; var result = interactors.Approve(code, id); var json = FormatterExtensions.AsJson <Result>(Response, result); return(json); }); }
public void Approve_with_wrong_code_returns_an_error() { var result = _sut.Approve("wrong", "1234"); Assert.That(result, Is.TypeOf <ErrorCantApprove>()); }