Exemplo n.º 1
0
        public void Can_ReturnFalse_WhenException()
        {
            // Arrange
            var role = new TestRole();
            var sut  = new RolePermissions(new List <Role> {
                role
            });

            // Act
            var result = sut.Can(UserRoles.MedicalExaminerOfficer, Permission.CreateUserPermission);

            // Assert
            result.Should().BeFalse();
        }
Exemplo n.º 2
0
        public void Can_ReturnTrue()
        {
            // Arrange
            var role = new TestRole();
            var sut  = new RolePermissions(new List <Role> {
                role
            });

            // Act
            var result = sut.Can(UserRoles.MedicalExaminer, Permission.AddEventToExamination);

            // Assert
            result.Should().BeTrue();
        }