public void AppliesToControllerAndActionOnEntitySetRoutingConvention_Throws_Context() { // Arrange EntitySetRoutingConvention convention = new EntitySetRoutingConvention(); // Act & Assert ExceptionAssert.ThrowsArgumentNull(() => convention.AppliesToController(null), "context"); ExceptionAssert.ThrowsArgumentNull(() => convention.AppliesToAction(null), "context"); }
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); }