Пример #1
0
            public void WithAlarmManagerEditPermissionSetExpectTrue()
            {
                // Arrange
                var permission = new Permission
                                     {
                                         ResourceKey = AlarmManagerResourceIdentifier,
                                         PermissionLevel = EditPermission
                                     };

                // Act
                var isSet = permission.IsViewAlarmManagerPermission;

                // Assert
                Assert.IsTrue(isSet);
            }
Пример #2
0
            public void WithLessThanViewPermissionSetExpectFalse()
            {
                // Arrange
                var permission = new Permission
                                     {
                                         ResourceKey = AlarmManagerResourceIdentifier,
                                         PermissionLevel = LessThanViewPermission
                                     };

                // Act
                var isSet = permission.IsViewAlarmManagerPermission;

                // Assert
                Assert.IsFalse(isSet);

            }
Пример #3
0
 public UserDetails()
 {
     Partitions = new Partition[0];
     Permissions = new Permission[0];
 }
Пример #4
0
            public void WithWrongResourceKeyButCorrectPermissionLevelExpectFalse()
            {
                // Arrange
                var permission = new Permission
                {
                    ResourceKey = "Made Up Resource",
                    PermissionLevel = ViewPermission
                };

                // Act
                var isSet = permission.IsViewAlarmManagerPermission;

                // Assert
                Assert.IsFalse(isSet);
            }
Пример #5
0
            public void WithTooLowOfAPermissionExpectFalse()
            {
                // Arrange
                var permission = new Permission
                                     {
                                         ResourceKey = ReportsResourceIdentifier,
                                         PermissionLevel = LessThanViewPermission
                                     };

                // Act
                var isSet = permission.IsViewReportsPermission;

                // Assert
                Assert.IsFalse(isSet);
            }