Example #1
0
        public void ImageContentNull()
        {
            var config = Substitute.For <IConfiguration>();

            config.Get("images").Returns((string)null);
            var cdnConfig = new ContentDeliveryNetworkConfiguration(config);

            Assert.Null(cdnConfig.Images);
        }
Example #2
0
        public void ImageContent()
        {
            const string ImageCdn = "some/test/path";

            var config = Substitute.For <IConfiguration>();

            config.Get("images").Returns(ImageCdn);

            var cdnConfig = new ContentDeliveryNetworkConfiguration(config);

            Assert.Equal(ImageCdn, cdnConfig.Images);
        }
Example #3
0
        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 scriptsConfig = CreateConfig(values);

            config.GetSubKey("Scripts").Returns(scriptsConfig);

            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"]);
        }