コード例 #1
0
        public void IsAllowed_NoOperationsPermitted_OperationIsNotAllowed()
        {
            // Arrange
            var operationToCheck  = Tuple.Create(AREA_1_ID, OPERATION_3_ID);
            var allowedOperations = new AllowedOperations(new List <AuthOperation>());

            // Act
            bool result = allowedOperations.IsAllowed(operationToCheck);

            // Assert
            Assert.IsFalse(result);
        }
コード例 #2
0
        public void IsAllowed_OperationPermitted_OperationIsAllowed()
        {
            // Arrange
            var operationToCheck  = Tuple.Create(AREA_1_ID, OPERATION_1_ID);
            var allowedOperations = new AllowedOperations(new List <AuthOperation>
            {
                Tuple.Create(AREA_1_ID, OPERATION_1_ID),
                Tuple.Create(AREA_1_ID, OPERATION_2_ID)
            });

            // Act
            bool result = allowedOperations.IsAllowed(operationToCheck);

            // Assert
            Assert.IsTrue(result);
        }