Test driven developing with EPiServer.
Set up EPiServer for test driven developmentHow to make test rum for both MsTest and NUnitExternal Links
EPiAbstractions - Creates facades for most used EPiServer classesUsing anonymous functions for events
importer.ResolvePageId += (sender, e) => Assert.IsFalse(String.IsNullOrEmpty(e.Value));
Mock HttpResponse.Headers
Create a IHttpResponse
public NameValueCollection ResponseHeaders = new NameValueCollection();
...
_responseMock = new Mock<IHttpResponse>();
_requestMock.Setup(rm => rm.Headers).Returns(ResponseHeaders);
_responseMock.Setup(p => p.AddHeader(It.IsAny<string>(), It.IsAny<string>()))
.Callback((string name, string val) => ResponseHeaders.Add(name, val));