public void Authenticate_No_User()
        {
            var context = new MockContext();
            var encrpytor = new Mock<IEncryptor>();
            var users = new Mock<DbSet<User>>();
            var userStore = new UserStore(context, encrpytor.Object);

            Assert.IsFalse(userStore.Authenticate("test", "test"));
        }
        public void Authenticate_User()
        {
            var context = new MockContext();
            var encrpytor = new Mock<IEncryptor>();
            var salt = new byte[] { 1 };
            var password = new byte[] { 1, 2, 3, 4};
            context.Users.Add(new User{
                Username = "******", Password = password, Salt = salt
            });
            encrpytor.Setup(e => e.GetPassword(salt, "test")).Returns(new byte[] { 1, 2, 3, 4 });

            var userStore = new UserStore(context, encrpytor.Object);

            Assert.IsTrue(userStore.Authenticate("test", "test"));
        }
        public void Authenticate_User_Wrong_Password()
        {
            var context = new MockContext();
            var encrpytor = new Mock<IEncryptor>();
            context.Users.Add(new User { Username = "******", Password = new byte[] { 1, 2 }});
            var userStore = new UserStore(context, encrpytor.Object);

            Assert.IsFalse(userStore.Authenticate("test", "test"));
        }