public ScriptRegistrarBuilderTests() { ViewContext viewContext = new ViewContext { HttpContext = TestHelper.CreateMockedHttpContext().Object, ViewData = new ViewDataDictionary() }; _scriptRegistrar = new ScriptRegistrar(new WebAssetItemCollection(WebAssetDefaultSettings.ScriptFilesPath), new List<IScriptableComponent>(), viewContext, new Mock<IWebAssetItemMerger>().Object, new Mock<ScriptWrapperBase>().Object); _builder = new ScriptRegistrarBuilder(_scriptRegistrar); }
public ScriptRegistrarBuilderTests() { ViewContext viewContext = new ViewContext { HttpContext = TestHelper.CreateMockedHttpContext().Object, ViewData = new ViewDataDictionary() }; _scriptRegistrar = new ScriptRegistrar(new WebAssetCollection(WebAssetDefaultSettings.ScriptFilesPath), new List <IScriptableComponent>(), viewContext, new Mock <IWebAssetCollectionResolver>().Object, new Mock <ScriptWrapperBase>().Object); _builder = new ScriptRegistrarBuilder(_scriptRegistrar); }
public ViewComponentFactoryTests() { ViewContext viewContext = new ViewContext { HttpContext = TestHelper.CreateMockedHttpContext().Object, ViewData = new ViewDataDictionary() }; StyleSheetRegistrar styleSheetRegistrar = new StyleSheetRegistrar(new WebAssetItemCollection(WebAssetDefaultSettings.StyleSheetFilesPath), new List<IStyleableComponent>(), viewContext, new Mock<IWebAssetItemMerger>().Object); StyleSheetRegistrarBuilder styleSheetRegistrarBuilder = new StyleSheetRegistrarBuilder(styleSheetRegistrar); ScriptRegistrar scriptRegistrar = new ScriptRegistrar(new WebAssetItemCollection(WebAssetDefaultSettings.ScriptFilesPath), new List<IScriptableComponent>(), viewContext, new Mock<IWebAssetItemMerger>().Object, new Mock<ScriptWrapperBase>().Object); ScriptRegistrarBuilder scriptRegistrarBuilder = new ScriptRegistrarBuilder(scriptRegistrar); _factory = new ViewComponentFactory(styleSheetRegistrarBuilder, scriptRegistrarBuilder); }
public ScriptRegistrarTests() { httpContext = TestHelper.CreateMockedHttpContext(); scripts = new WebAssetCollection(WebAssetDefaultSettings.ScriptFilesPath); scriptableComponents = new List <IScriptableComponent>(); resolver = new Mock <IWebAssetCollectionResolver>(); scriptWrapper = new Mock <ScriptWrapperBase>(); viewContext = new ViewContext { HttpContext = httpContext.Object, ViewData = new ViewDataDictionary() }; scriptRegistrar = new ScriptRegistrar(scripts, scriptableComponents, viewContext, resolver.Object, scriptWrapper.Object); }
public ScriptRegistrarTests() { _httpContext = TestHelper.CreateMockedHttpContext(); _scripts = new WebAssetItemCollection(WebAssetDefaultSettings.ScriptFilesPath); _scriptableComponents = new List<IScriptableComponent>(); _assetMerger = new Mock<IWebAssetItemMerger>(); _scriptWrapper = new Mock<ScriptWrapperBase>(); _viewContext = new ViewContext { HttpContext = _httpContext.Object, ViewData = new ViewDataDictionary() }; _scriptRegistrar = new ScriptRegistrar(_scripts, _scriptableComponents, _viewContext, _assetMerger.Object, _scriptWrapper.Object); }
public ScriptRegistrarTests() { httpContext = TestHelper.CreateMockedHttpContext(); scripts = new WebAssetCollection(WebAssetDefaultSettings.ScriptFilesPath); scriptableComponents = new List<IScriptableComponent>(); resolver = new Mock<IWebAssetCollectionResolver>(); scriptWrapper = new Mock<ScriptWrapperBase>(); viewContext = new ViewContext { HttpContext = httpContext.Object, ViewData = new ViewDataDictionary() }; scriptRegistrar = new ScriptRegistrar(scripts, scriptableComponents, viewContext, resolver.Object, scriptWrapper.Object); }
public ViewComponentFactoryTests() { ViewContext viewContext = new ViewContext { HttpContext = TestHelper.CreateMockedHttpContext().Object, ViewData = new ViewDataDictionary() }; StyleSheetRegistrar styleSheetRegistrar = new StyleSheetRegistrar(new WebAssetCollection(WebAssetDefaultSettings.StyleSheetFilesPath), viewContext, new Mock <IWebAssetCollectionResolver>().Object); StyleSheetRegistrarBuilder styleSheetRegistrarBuilder = new StyleSheetRegistrarBuilder(styleSheetRegistrar); ScriptRegistrar scriptRegistrar = new ScriptRegistrar(new WebAssetCollection(WebAssetDefaultSettings.ScriptFilesPath), new List <IScriptableComponent>(), viewContext, new Mock <IWebAssetCollectionResolver>().Object, new Mock <ScriptWrapperBase>().Object); ScriptRegistrarBuilder scriptRegistrarBuilder = new ScriptRegistrarBuilder(scriptRegistrar); htmlHelper = TestHelper.CreateHtmlHelper(); _factory = new ViewComponentFactory(htmlHelper, new Mock <IClientSideObjectWriterFactory>().Object, styleSheetRegistrarBuilder, scriptRegistrarBuilder); }
public ViewComponentModelFactoryTests() { ViewContext viewContext = new ViewContext { HttpContext = TestHelper.CreateMockedHttpContext().Object, ViewData = new ViewDataDictionary() }; StyleSheetRegistrar styleSheetRegistrar = new StyleSheetRegistrar(new WebAssetCollection(WebAssetDefaultSettings.StyleSheetFilesPath), viewContext, new Mock <IWebAssetCollectionResolver>().Object); StyleSheetRegistrarBuilder styleSheetRegistrarBuilder = new StyleSheetRegistrarBuilder(styleSheetRegistrar); ScriptRegistrar scriptRegistrar = new ScriptRegistrar(new WebAssetCollection(WebAssetDefaultSettings.ScriptFilesPath), new List <IScriptableComponent>(), viewContext, new Mock <IWebAssetCollectionResolver>().Object, new Mock <ScriptWrapperBase>().Object); ScriptRegistrarBuilder scriptRegistrarBuilder = new ScriptRegistrarBuilder(scriptRegistrar); htmlHelper = TestHelper.CreateHtmlHelper <TestModel>(); htmlHelper.ViewData.Model = new TestModel { ID = 1, DoubleProperty = 1.0, DecimalProperty = 1.0m, DateTimeProperty = DateTime.Today, TimeProperty = DateTime.Now.TimeOfDay, ComplexModel = new TestModel() }; factory = new ViewComponentFactory <TestModel>(htmlHelper, new Mock <IClientSideObjectWriterFactory>().Object, styleSheetRegistrarBuilder, scriptRegistrarBuilder); }
public ViewComponentModelFactoryTests() { ViewContext viewContext = new ViewContext { HttpContext = TestHelper.CreateMockedHttpContext().Object, ViewData = new ViewDataDictionary() }; StyleSheetRegistrar styleSheetRegistrar = new StyleSheetRegistrar(new WebAssetCollection(WebAssetDefaultSettings.StyleSheetFilesPath), viewContext, new Mock<IWebAssetCollectionResolver>().Object); StyleSheetRegistrarBuilder styleSheetRegistrarBuilder = new StyleSheetRegistrarBuilder(styleSheetRegistrar); ScriptRegistrar scriptRegistrar = new ScriptRegistrar(new WebAssetCollection(WebAssetDefaultSettings.ScriptFilesPath), new List<IScriptableComponent>(), viewContext, new Mock<IWebAssetCollectionResolver>().Object, new Mock<ScriptWrapperBase>().Object); ScriptRegistrarBuilder scriptRegistrarBuilder = new ScriptRegistrarBuilder(scriptRegistrar); htmlHelper = TestHelper.CreateHtmlHelper<TestModel>(); htmlHelper.ViewData.Model = new TestModel { ID = 1, DoubleProperty = 1.0, DecimalProperty = 1.0m, DateTimeProperty = DateTime.Today, TimeProperty = DateTime.Now.TimeOfDay, ComplexModel = new TestModel() }; factory = new ViewComponentFactory<TestModel>(htmlHelper, new Mock<IClientSideObjectWriterFactory>().Object, styleSheetRegistrarBuilder, scriptRegistrarBuilder); }
public void ScriptRegistrar_operator_should_return_internal_script_registrar() { ScriptRegistrar scriptRegistrar = _builder; Assert.Same(_scriptRegistrar, scriptRegistrar); }