I am very, very new to unit testing and am trying to write a test for a pretty simple method:
public class myClass : RequireHttpsAttribute { public override
I encountered an issue with the accepted solution using ASP.NET MVC 4. To resolve it I mocked the http context Items attribute otherwise the sut.OnAuthorization was causing an object is undefined exception:
sut.OnAuthorization
MockHttpContext.Setup(x => x.Items) .Returns(new System.Collections.Generic.Dictionary());