public void Should_create_salt()
        {
            ICryptographer cryptographer = new Cryptographer();

            var salt = cryptographer.CreateSalt();
            Assert.That(salt.Length, Is.EqualTo(88));
        }
Example #2
0
 private User[] CreateUsers()
 {
     var crypto = new Cryptographer();
     string salt = crypto.CreateSalt();
     return new[]
            	{
            		new User
            			{
            				Name = "Joe User",
            				Username = "******",
            				EmailAddress = "*****@*****.**",
            				PasswordHash = crypto.GetPasswordHash("password", salt),
            				PasswordSalt = salt,
            			},
            		new User
            			{
            				Name = "Jeffrey Palermo",
            				EmailAddress = "*****@*****.**",
            				Username = "******",
            				PasswordHash = crypto.GetPasswordHash("beer", salt),
            				PasswordSalt = salt,
            			},
            		new User
            			{
            				Name = "Homer Simpson",
            				EmailAddress = "*****@*****.**",
            				Username = "******",
            				PasswordHash = crypto.GetPasswordHash("beer", salt),
            				PasswordSalt = salt,
            			},
            		new User
            			{
            				Name = "Bart Simpson",
            				EmailAddress = "*****@*****.**",
            				Username = "******",
            				PasswordHash = crypto.GetPasswordHash("beer", salt),
            				PasswordSalt = salt,
            			}
            	};
 }