Пример #1
0
        public void Should_return_null_when_parameters_are_missing_or_invalid(string username, string email)
        {
            // Given
            var userService = new UserService(A.Dummy<IRavenSessionProvider>(), A.Dummy<IPasswordService>());

            // When
            var password = userService.CreateUser(username, email);

            // Then
            password.ShouldBe(null);
        }
Пример #2
0
        public void Should_return_password_when_valid_username_and_password_are_supplied()
        {
            // Given
            var username = MakeFake.Username;
            var email = MakeFake.Email;
            var fakePasswordService = MakeFake.PasswordService();
            var userService = new UserService(A.Dummy<IRavenSessionProvider>(), fakePasswordService);

            // When
            var password = userService.CreateUser(username, email);

            // Then
            password.ShouldNotBe(null);
            password.Length.ShouldBe(PasswordService.PasswordCharactersCount);
        }