Beispiel #1
0
        public void CreateUser()
        {
            var userRepository = new MockUserRepository();
            var userWorkflow   = new UserWorkflow(userRepository);

            userWorkflow.CreateUser("easy", "crud");
            userRepository.CalledCreateUser.Should().BeTrue();
            userRepository.User.Username.Should().Be("easy");
        }
Beispiel #2
0
        public void ExistingUserShouldThrowException()
        {
            var userRepository = new MockUserRepository();
            var userWorkflow   = new UserWorkflow(userRepository);

            Action action = () => userWorkflow.CreateUser("existing_user", "anyPassword");

            action.Should().Throw <UserAlreadyExistException>("User already exists");
        }