public void AnonymousUserCantReadPrivateItem() { var auth = new Auth(null, ICurrentUserMock.GetAnonymousUser()); var owned = IOwnedMock.Get(null, Access.Private, Access.Private); Assert.False(auth.CanRead(owned)); }
public void AnonymousUserDontOwnsItem() { var auth = new Auth(null, ICurrentUserMock.GetAnonymousUser()); var owned = IOwnedMock.Get(null, Access.Private, Access.Private); Assert.False(auth.Owns(owned)); }
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)); }
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)); }