示例#1
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));
        }
示例#2
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"));
        }
示例#3
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());
        }