Exemple #1
0
            public void WithAlarmManagerEditPermissionSetExpectTrue()
            {
                // Arrange
                var permission = new Permission
                                     {
                                         ResourceKey = AlarmManagerResourceIdentifier,
                                         PermissionLevel = EditPermission
                                     };

                // Act
                var isSet = permission.IsViewAlarmManagerPermission;

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

                // Act
                var isSet = permission.IsViewAlarmManagerPermission;

                // Assert
                Assert.IsFalse(isSet);

            }
Exemple #3
0
 public UserDetails()
 {
     Partitions = new Partition[0];
     Permissions = new Permission[0];
 }
Exemple #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);
            }
Exemple #5
0
            public void WithTooLowOfAPermissionExpectFalse()
            {
                // Arrange
                var permission = new Permission
                                     {
                                         ResourceKey = ReportsResourceIdentifier,
                                         PermissionLevel = LessThanViewPermission
                                     };

                // Act
                var isSet = permission.IsViewReportsPermission;

                // Assert
                Assert.IsFalse(isSet);
            }