コード例 #1
0
        public void matches_credentials_postive()
        {
            var user1 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("something")
            };

            var user2 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("else")
            };

            theRepository.Update(user1);
            theRepository.Update(user2);

            theMembership.MatchesCredentials(new LoginRequest
            {
                UserName = "******",
                Password = "******"
            }).ShouldBeFalse();

            theMembership.MatchesCredentials(new LoginRequest
            {
                UserName = "******",
                Password = "******"
            }).ShouldBeFalse();

            theMembership.MatchesCredentials(new LoginRequest
            {
                UserName = "******",
                Password = "******"
            }).ShouldBeFalse();
        }
コード例 #2
0
        public void matches_credentials_negative()
        {
            var user1 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("something")
            };

            var user2 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("else")
            };

            theRepository.Update(user1);
            theRepository.Update(user2);


            theMembership.MatchesCredentials(new LoginRequest
            {
                UserName = "******",
                Password = "******"
            }).ShouldBeTrue();

            theMembership.MatchesCredentials(new LoginRequest
            {
                UserName = "******",
                Password = "******"
            }).ShouldBeTrue();
        }
コード例 #3
0
ファイル: ModelFixture.cs プロジェクト: kingreatwill/fubumvc
        public void UsersAre(string UserName, string Password)
        {
            var user = new User
            {
                UserName = UserName,
                Password = Context.Service<IPasswordHash>().CreateHash(Password)
            };

            _repository.Update(user);
        }
コード例 #4
0
        public void find_by_name()
        {
            var user1 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("something")
            };

            var user2 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("else")
            };

            theRepository.Update(user1);
            theRepository.Update(user2);

            theMembership.FindByName("jeremy").ShouldBeTheSameAs(user1);
            theMembership.FindByName("josh").ShouldBeTheSameAs(user2);
        }
コード例 #5
0
        public void find_by_name()
        {
            var user1 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("something")
            };

            var user2 = new FubuMVC.RavenDb.Membership.User
            {
                UserName = "******",
                Password = theHash.CreateHash("else")
            };

            theRepository.Update(user1);
            theRepository.Update(user2);

            theMembership.FindByName("jeremy").ShouldBeTheSameAs(user1);
            theMembership.FindByName("josh").ShouldBeTheSameAs(user2);
        }