public IActionResult RegisterUser([FromBody] RegisterUserCommand command) { RegisterUserService service = new RegisterUserService(command, _repository); service.Run(); return(ReturnResponse(service, new { message = "Usuário cadastrado com sucesso" }, null)); }
public void Dado_um_username_invalido_deve_gerar_notificacao2() { RegisterUserCommand command = new RegisterUserCommand(); command.Username = ""; command.Password = "******"; RegisterUserService service = new RegisterUserService(command, new FakeUserRepository()); service.Run(); Assert.IsTrue(service.HasNotifications()); }
public void Dado_um_username_invalido_deve_gerar_notificacao() { var runtime = new Runtime(); RegisterUserCommand command = new RegisterUserCommand(); command.Username = ""; command.Password = "******"; RegisterUserService service = new RegisterUserService(command, new FakeUserRepository()); service.Run(); runtime.AddNotifications(service.GetNotifications()); Assert.IsTrue(runtime.HasNotifications()); }
public void TestMethod1() { var runtime = new Runtime(); RegisterUserCommand command = new RegisterUserCommand(); command.Username = ""; command.Password = "******"; RegisterUserService service = new RegisterUserService(command, new FakeUserRepository()); service.Run(); runtime.AddNotifications(service.GetNotifications()); Assert.IsTrue(runtime.HasNotifications()); }