Ejemplo n.º 1
0
        public static void Initialize_ThrowsProviderException_ForMissingBaseUri()
        {
            // Arrange
            var provider = new RemoteAssetProvider();
            var config   = new NameValueCollection(0);

            // Act & Assert
            Assert.Throws <ProviderException>(() => provider.Initialize("MyName", config));
        }
Ejemplo n.º 2
0
        public static void Initialize_DoesNotThrow_ForAbsoluteBaseUri()
        {
            // Arrange
            var provider = new RemoteAssetProvider();
            var config   = new NameValueCollection(1);

            config.Add("baseUri", "http://tempuri.org/my/relative/path");

            // Act
            provider.Initialize("MyName", config);
        }
Ejemplo n.º 3
0
        public static void Initialize_ThrowsProviderException_ForRelativeBaseUri()
        {
            // Arrange
            var provider = new RemoteAssetProvider();
            var config   = new NameValueCollection(1);

            config.Add("baseUri", "/my/relative/path");

            // Act & Assert
            Assert.Throws <ProviderException>(() => provider.Initialize("MyName", config));
        }
Ejemplo n.º 4
0
        public static void GetFontUri_ThrowsArgumentException_ForAbsolutePath()
        {
            // Arrange
            var provider = new RemoteAssetProvider();
            var config   = new NameValueCollection(1);

            config.Add("baseUri", "http://tempuri.org/");

            provider.Initialize("MyName", config);

            // Act & Assert
            Assert.Throws <ArgumentOutOfRangeException>(() => provider.GetFontUri("/my/absolute/font/path"));
        }
Ejemplo n.º 5
0
        public static void GetFontUri_ThrowsArgumentNullException_ForNullPath()
        {
            // Arrange
            var provider = new RemoteAssetProvider();
            var config   = new NameValueCollection(1);

            config.Add("baseUri", "http://tempuri.org/");

            provider.Initialize("MyName", config);

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => provider.GetFontUri(null));
        }
Ejemplo n.º 6
0
        public static void GetFontUri_ReturnsExpectedResult(string value, string expectedValue)
        {
            // Arrange
            var provider = new RemoteAssetProvider();
            var config   = new NameValueCollection(1);

            config.Add("baseUri", "http://tempuri.org/");

            provider.Initialize("MyName", config);

            // Act
            var resultUri = provider.GetFontUri(value);

            // Act & Assert
            Assert.Equal(expectedValue, resultUri.ToString());
        }