public void OnActionExecuted_ThrowsArgumentNull_ActionExecutedContext() { // Arrange ETagActionFilterAttribute filter = new ETagActionFilterAttribute(); // Act & Assert ExceptionAssert.ThrowsArgumentNull(() => filter.OnActionExecuted(null), "actionExecutedContext"); }
public void OnActionExecuted_ThrowsArgumentNull_PathOnActionExecutedContext() { // Arrange ETagActionFilterAttribute filter = new ETagActionFilterAttribute(); HttpContext httpContext = new DefaultHttpContext(); ActionContext actionContext = new ActionContext(httpContext, new RouteData(), new ActionDescriptor()); ActionExecutedContext context = new ActionExecutedContext(actionContext, new List <IFilterMetadata>(), null); // Act & Assert ExceptionAssert.ThrowsArgumentNull(() => filter.OnActionExecuted(context), "path"); }
public void OnActionExecuted_ThrowsArgumentNull_ETagHandlerOnActionExecutedContext() { // Arrange ETagActionFilterAttribute filter = new ETagActionFilterAttribute(); HttpContext httpContext = new DefaultHttpContext(); ActionContext actionContext = new ActionContext(httpContext, new RouteData(), new ActionDescriptor()); ActionExecutedContext context = new ActionExecutedContext(actionContext, new List <IFilterMetadata>(), null); httpContext.ODataFeature().Path = new ODataPath(); httpContext.ODataFeature().Model = new EdmModel(); httpContext.ODataFeature().SubServiceProvider = new ServiceCollection().BuildServiceProvider(); // Act & Assert ExceptionAssert.ThrowsArgumentNull(() => filter.OnActionExecuted(context), "etagHandler"); }
public void GetSingleEntityEntityType_Returns_EntityType() { // Arrange & Act & Assert Assert.Null(ETagActionFilterAttribute.GetSingleEntityEntityType(null)); Assert.Null(ETagActionFilterAttribute.GetSingleEntityEntityType(new ODataPath())); }