public void ImageContentNull() { var config = Substitute.For<IConfiguration>(); config["images"].Returns((string)null); var cdnConfig = new ContentDeliveryNetworkConfiguration(config); Assert.Null(cdnConfig.Images); }
public void ImageContent() { const string ImageCdn = "some/test/path"; var config = Substitute.For<IConfiguration>(); config["images"].Returns(ImageCdn); var cdnConfig = new ContentDeliveryNetworkConfiguration(config); Assert.Equal(ImageCdn, cdnConfig.Images); }
public void ScriptStylesParse() { var values = new[] { new ConfigPathHelper{ Name="item1", Path="path1 path3 path4"}, new ConfigPathHelper{ Name="item2", Path="path2"}, }; var config = Substitute.For<IConfiguration>(); var scriptsConfigSection = CreateConfigSection(values); config.GetSection("Scripts").Returns(scriptsConfigSection); var cdnConfig = new ContentDeliveryNetworkConfiguration(config); Assert.Equal(2, cdnConfig.Scripts.Count); Assert.Equal(new[] { "path1", "path3", "path4" }, cdnConfig.Scripts["item1"]); Assert.Equal(new[] { "path2" }, cdnConfig.Scripts["item2"]); }