コード例 #1
0
            public void GivenRoles_AppliesRoles()
            {
                // Arrange
                var roles = new [] { UserRole.Licenser };

                // Act
                var attribute = new SubmarineAuthorize(roles);

                // Assert
                Assert.That(attribute.Roles.Contains(UserRole.Administrator.ToString()));
            }
コード例 #2
0
            public void GivenRoles_AppliesRolesPlusAdministrator()
            {
                // Arrange
                var roles = new [] { UserRole.Licenser };

                // Act
                var attribute = new SubmarineAuthorize(roles);

                // Assert
                var stringifiedRoles = string.Join(", ", UserRole.Licenser, UserRole.Administrator);

                Assert.That(attribute.Roles, Is.EqualTo(stringifiedRoles));
            }