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