예제 #1
0
        public void AnonymousUserCantReadPrivateItem()
        {
            var auth  = new Auth(null, ICurrentUserMock.GetAnonymousUser());
            var owned = IOwnedMock.Get(null, Access.Private, Access.Private);

            Assert.False(auth.CanRead(owned));
        }
예제 #2
0
        public void AnonymousUserDontOwnsItem()
        {
            var auth  = new Auth(null, ICurrentUserMock.GetAnonymousUser());
            var owned = IOwnedMock.Get(null, Access.Private, Access.Private);

            Assert.False(auth.Owns(owned));
        }
예제 #3
0
        public void AuthenticatedUserOwnsItem()
        {
            var login = "******";
            var auth  = new Auth(null, ICurrentUserMock.GetAuthenticatedUser(login));
            var owned = IOwnedMock.Get(login, Access.Private, Access.Private);

            Assert.True(auth.Owns(owned));
        }
예제 #4
0
        public void AuthenticatedUserDontOwnsItem()
        {
            var login1 = "UserLogin1";
            var login2 = "UserLogin2";
            var auth   = new Auth(null, ICurrentUserMock.GetAuthenticatedUser(login1));
            var owned  = IOwnedMock.Get(login2, Access.Private, Access.Private);

            Assert.False(auth.Owns(owned));
        }