The crypto provider.
Inheritance: ICryptoProvider
 public void Setup()
 {
     this.userRepositoryMock = new Mock<IUserRepository>();
     this.cryptoProvider = new CryptoProvider();
     this.humanTaskRepositoryMock = new Mock<IHumanTaskRepository>();
     this.reminderProcessor = new Mock<IReminderProcessor>();
     this.taskProcessor = new TaskProcessor(this.humanTaskRepositoryMock.Object, this.reminderProcessor.Object, this.userRepositoryMock.Object);
     this.userProcessor = new UserProcessor(this.userRepositoryMock.Object, this.cryptoProvider, this.taskProcessor);
 }
        public void ShouldNot_LogonUser_WhenSuchUserDoesNotExistAndVerify()
        {
            this.cryptoProvider = new CryptoProvider();
            const string Username = "******";
            const string Password = "******";
            this.userRepositoryMock.Setup(x => x.GetByName(Username)).Returns((User)null);

            // act
            var result = this.userProcessor.LogOnUser(Username, Password);

            // arrange
            Assert.AreEqual(result, false);
        }
        public void ShouldNot_LogonUser_WhenSuchUserExistButNotVerify()
        {
            this.cryptoProvider = new CryptoProvider();
            const string Username = "******";
            const string Password = "******";
            const string Email = "*****@*****.**";
            const int Id = 100500;

            var salt = this.cryptoProvider.CreateSalt();
            var user = new User
            {
                Id = Id,
                UserName = Username,
                Email = Email,
                Credentials = new Credentials
                {
                    Salt = salt,
                    Passwordhash = this.cryptoProvider.CreateCryptoPassword(Password, salt),
                    IsVerify = false
                }
            };
            this.userRepositoryMock.Setup(x => x.GetByName(Username)).Returns(user);

            // act
            var result = this.userProcessor.LogOnUser(Username, Password);

            // arrange
            Assert.AreEqual(result, false);
        }