Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay committed Oct 16, 2013
1 parent c8409b6 commit 47df191
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Moq;
Expand Down Expand Up @@ -113,14 +114,9 @@ private static Mock<ActionExecutingContext> CreateActionFilterContext(string api
var mockFilterContext = new Mock<ActionExecutingContext>();
var mockController = new Mock<Controller>();

mockFilterContext.Setup(ctx => ctx.Controller).Returns(mockController.Object);
mockController.Object.ControllerContext = new ControllerContext
{
RouteData = new RouteData
{
Values = { { "apiKey", apiKey } }
}
};
mockFilterContext.Setup(ctx => ctx.ActionParameters).Returns(new Dictionary<string, object> {
{ "apiKey", apiKey }
});
return mockFilterContext;
}

Expand Down

0 comments on commit 47df191

Please sign in to comment.