public void ShouldStoreUserWhenRequested()
        {
            var registeredUsersStorage     = Substitute.For <IRegisteredUsersStorage>();
            var userRegistrationController = new UserRegistrationController(registeredUsersStorage);

            var userRegistrationRequest = Root.Any.Instance <UserRegistrationRequest>();
            var response = userRegistrationController.AddUserToRegistered(userRegistrationRequest);
        }
Exemplo n.º 2
0
        public void ShouldStoreUserWhenRequested()
        {
            var registeredUsersStorage     = Substitute.For <IRegisteredUsersStorage>();
            var userRegistrationController = new UserRegistrationController(registeredUsersStorage);

            var userRegistrationRequest = Root.Any.Instance <UserRegistrationRequest>();
            var response = userRegistrationController.AddUserToRegistered(userRegistrationRequest);

            response.Should().BeOfType <OkResult>();
            registeredUsersStorage.Received().AddUser(userRegistrationRequest.Login,
                                                      userRegistrationRequest.Password);
        }