Esempio n. 1
0
            public void WithNullPermissionsExpectFalse()
            {
                // Arrange
                var userDetails = new UserDetails();

                // Act
                var isSet = userDetails.CanViewReports;

                // Assert
                Assert.IsFalse(isSet);
            }
Esempio n. 2
0
            public void WithNoPermissionsExpectFalse()
            {
                // Arrange
                var userDetails = new UserDetails {Permissions = new Permission[0]};

                // Act
                var isSet = userDetails.CanViewAlarmManager;

                // Assert
                Assert.IsFalse(isSet);
            }
Esempio n. 3
0
            public void WithExpectedPermissionsExpectTrue()
            {
                // Arrange
                var userDetails = new UserDetails
                                      {
                                          Permissions =
                                              new[]
                                                  {
                                                      new Permission
                                                          {
                                                              PermissionLevel = ViewPermission,
                                                              ResourceKey = AlarmManagerResourceIdentifier
                                                          }
                                                  }
                                      };

                // Act
                var isSet = userDetails.CanViewAlarmManager;

                // Assert
                Assert.IsTrue(isSet);
            }