public NDjangoViewEngineFixture() { this.engine = new NDjangoViewEngine(); var cache = A.Fake<IViewCache>(); A.CallTo(() => cache.GetOrAdd(A<ViewLocationResult>.Ignored, A<Func<ViewLocationResult, string>>.Ignored)) .ReturnsLazily(x => { var result = x.GetArgument<ViewLocationResult>(0); return x.GetArgument<Func<ViewLocationResult, string>>(1).Invoke(result); }); this.renderContext = A.Fake<IRenderContext>(); A.CallTo(() => this.renderContext.ViewCache).Returns(cache); }
public NDjangoViewEngineFixture() { this.engine = new NDjangoViewEngine(); var cache = A.Fake <IViewCache>(); A.CallTo(() => cache.GetOrAdd(A <ViewLocationResult> .Ignored, A <Func <ViewLocationResult, ITemplate> > .Ignored)) .ReturnsLazily(x => { var result = x.GetArgument <ViewLocationResult>(0); return(x.GetArgument <Func <ViewLocationResult, ITemplate> >(1).Invoke(result)); }); this.renderContext = A.Fake <IRenderContext>(); A.CallTo(() => this.renderContext.ViewCache).Returns(cache); }
public NDjangoViewCompilerFixture() { this.engine = new NDjangoViewEngine(); }