public void CanMapReadPermission(Permission expectedPermission, bool expectedResult) { var map = new PermissionMap { Permissions = Permission.Read, Roles = new[] { "rolename" } }; Assert.That(map.MapsTo(expectedPermission), Is.EqualTo(expectedResult)); Assert.That(map.Authorizes(user, item, expectedPermission), Is.EqualTo(expectedResult)); }
public void CanMapFullPermission(Permission expectedPermission) { var map = new PermissionMap { Permissions = Permission.Full, Roles = new[] { "rolename" } }; Assert.That(map.MapsTo(expectedPermission), Is.True); Assert.That(map.Authorizes(user, item, expectedPermission), Is.True); }