Exemplo n.º 1
0
        public void AppliesToControllerAndActionOnEntitySetRoutingConvention_Throws_Context()
        {
            // Arrange
            EntitySetRoutingConvention convention = new EntitySetRoutingConvention();

            // Act & Assert
            ExceptionAssert.ThrowsArgumentNull(() => convention.AppliesToController(null), "context");
            ExceptionAssert.ThrowsArgumentNull(() => convention.AppliesToAction(null), "context");
        }
Exemplo n.º 2
0
        public void AppliesToControllerReturnsExpectedForController(Type controllerType, bool expected)
        {
            // Arrange
            ControllerModel controller                       = ControllerModelHelpers.BuildControllerModel(controllerType);
            ODataControllerActionContext context             = ODataControllerActionContextHelpers.BuildContext(string.Empty, EdmModel, controller);
            EntitySetRoutingConvention   entitySetConvention = ConventionHelpers.CreateConvention <EntitySetRoutingConvention>();

            // Act
            bool actual = entitySetConvention.AppliesToController(context);

            // Assert
            Assert.Equal(expected, actual);
        }