예제 #1
0
        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));
        }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }
예제 #4
0
        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());
        }