misc: Remove URI check from EmbedBuilder (#1778)

`Uri.IsWellFormedUriString()` doesn't return the expected result for specific urls, removed until the DotNet team actually resolves it ( https://github.com/dotnet/runtime/issues/21626 )
This commit is contained in:
Yeba
2021-04-28 15:48:15 +02:00
committed by GitHub
parent f67cd8ea55
commit 25b04c4a97
3 changed files with 6 additions and 114 deletions

View File

@@ -190,42 +190,6 @@ namespace Discord
Assert.Equal(result.ThumbnailUrl, url);
}
/// <summary>
/// Tests that invalid urls throw an <see cref="ArgumentException"/>.
/// </summary>
/// <param name="url">The url to set.</param>
[Theory]
[InlineData(" ")]
[InlineData("not a url")]
public void Url_Invalid(string url)
{
Assert.Throws<ArgumentException>(()
=> new EmbedBuilder()
.WithUrl(url));
Assert.Throws<ArgumentException>(()
=> new EmbedBuilder()
.WithImageUrl(url));
Assert.Throws<ArgumentException>(()
=> new EmbedBuilder()
.WithThumbnailUrl(url));
Assert.Throws<ArgumentException>(() =>
{
var b = new EmbedBuilder();
b.Url = url;
});
Assert.Throws<ArgumentException>(() =>
{
var b = new EmbedBuilder();
b.ImageUrl = url;
});
Assert.Throws<ArgumentException>(() =>
{
var b = new EmbedBuilder();
b.ThumbnailUrl = url;
});
}
/// <summary>
/// Tests the value of the <see cref="EmbedBuilder.Length"/> property when there are no fields set.
/// </summary>
@@ -343,24 +307,6 @@ namespace Discord
Assert.Equal(name, footer.Text);
}
/// <summary>
/// Tests that invalid URLs throw an <see cref="ArgumentException"/>.
/// </summary>
[Fact]
public void EmbedFooterBuilder_InvalidURL()
{
IEnumerable<string> InvalidUrls()
{
yield return "not a url";
}
foreach (var url in InvalidUrls())
{
Assert.Throws<ArgumentException>(() =>
{
new EmbedFooterBuilder().WithIconUrl(url);
});
}
}
/// <summary>
/// Tests that invalid text throws an <see cref="ArgumentException"/>.
/// </summary>
[Fact]