コード例 #1
0
        public ViewEngineFixture()
        {
            this.templateLocator = A.Fake<IViewLocator>();
            this.viewCompiler = A.Fake<IViewCompiler>();
            this.view = A.Fake<IView>();
            this.viewLocationResult = new ViewLocationResult(@"c:\some\fake\path", null);

            A.CallTo(() => templateLocator.GetTemplateContents("test")).Returns(viewLocationResult);
            A.CallTo(() => viewCompiler.GetCompiledView<object>(null)).Returns(view);
            A.CallTo(() => viewCompiler.GetCompiledView<MemoryStream>(null)).Returns(view);

            this.engine = new ViewEngine(templateLocator, viewCompiler);
        }