@@ -9,9 +9,9 @@ namespace Discord
/// </summary>
/// </summary>
public class EmbedBuilderTests
public class EmbedBuilderTests
{
{
private const string n ame = "chrisj";
private const string i con = "https://meowpuffygottem.fun/blob.png";
private const string u rl = "https://meowpuffygottem.fun/";
private const string N ame = "chrisj";
private const string I con = "https://meowpuffygottem.fun/blob.png";
private const string U rl = "https://meowpuffygottem.fun/";
/// <summary>
/// <summary>
/// Tests the behavior of <see cref="EmbedBuilder.WithAuthor(string, string, string)"/>.
/// Tests the behavior of <see cref="EmbedBuilder.WithAuthor(string, string, string)"/>.
@@ -24,12 +24,12 @@ namespace Discord
Assert.Null(builder.Author);
Assert.Null(builder.Author);
builder = new EmbedBuilder()
builder = new EmbedBuilder()
.WithAuthor(name, icon, u rl);
.WithAuthor(Name, Icon, U rl);
Assert.NotNull(builder.Author);
Assert.NotNull(builder.Author);
Assert.Equal(n ame, builder.Author.Name);
Assert.Equal(i con, builder.Author.IconUrl);
Assert.Equal(u rl, builder.Author.Url);
Assert.Equal(N ame, builder.Author.Name);
Assert.Equal(I con, builder.Author.IconUrl);
Assert.Equal(U rl, builder.Author.Url);
}
}
/// <summary>
/// <summary>
@@ -39,15 +39,15 @@ namespace Discord
public void WithAuthor_AuthorBuilder()
public void WithAuthor_AuthorBuilder()
{
{
var author = new EmbedAuthorBuilder()
var author = new EmbedAuthorBuilder()
.WithIconUrl(i con)
.WithName(n ame)
.WithUrl(u rl);
.WithIconUrl(I con)
.WithName(N ame)
.WithUrl(U rl);
var builder = new EmbedBuilder()
var builder = new EmbedBuilder()
.WithAuthor(author);
.WithAuthor(author);
Assert.NotNull(builder.Author);
Assert.NotNull(builder.Author);
Assert.Equal(n ame, builder.Author.Name);
Assert.Equal(i con, builder.Author.IconUrl);
Assert.Equal(u rl, builder.Author.Url);
Assert.Equal(N ame, builder.Author.Name);
Assert.Equal(I con, builder.Author.IconUrl);
Assert.Equal(U rl, builder.Author.Url);
}
}
/// <summary>
/// <summary>
@@ -58,13 +58,13 @@ namespace Discord
{
{
var builder = new EmbedBuilder()
var builder = new EmbedBuilder()
.WithAuthor((author) =>
.WithAuthor((author) =>
author.WithIconUrl(i con)
.WithName(n ame)
.WithUrl(u rl));
author.WithIconUrl(I con)
.WithName(N ame)
.WithUrl(U rl));
Assert.NotNull(builder.Author);
Assert.NotNull(builder.Author);
Assert.Equal(n ame, builder.Author.Name);
Assert.Equal(i con, builder.Author.IconUrl);
Assert.Equal(u rl, builder.Author.Url);
Assert.Equal(N ame, builder.Author.Name);
Assert.Equal(I con, builder.Author.IconUrl);
Assert.Equal(U rl, builder.Author.Url);
}
}
/// <summary>
/// <summary>
@@ -74,12 +74,12 @@ namespace Discord
public void EmbedAuthorBuilder()
public void EmbedAuthorBuilder()
{
{
var builder = new EmbedAuthorBuilder()
var builder = new EmbedAuthorBuilder()
.WithIconUrl(i con)
.WithName(n ame)
.WithUrl(u rl);
Assert.Equal(i con, builder.IconUrl);
Assert.Equal(n ame, builder.Name);
Assert.Equal(u rl, builder.Url);
.WithIconUrl(I con)
.WithName(N ame)
.WithUrl(U rl);
Assert.Equal(I con, builder.IconUrl);
Assert.Equal(N ame, builder.Name);
Assert.Equal(U rl, builder.Url);
}
}
/// <summary>
/// <summary>
@@ -217,15 +217,15 @@ namespace Discord
public void Length()
public void Length()
{
{
var e = new EmbedBuilder()
var e = new EmbedBuilder()
.WithAuthor(name, icon, u rl)
.WithAuthor(Name, Icon, U rl)
.WithColor(Color.Blue)
.WithColor(Color.Blue)
.WithDescription("This is the test description.")
.WithDescription("This is the test description.")
.WithFooter("This is the footer", u rl)
.WithImageUrl(u rl)
.WithThumbnailUrl(u rl)
.WithFooter("This is the footer", U rl)
.WithImageUrl(U rl)
.WithThumbnailUrl(U rl)
.WithTimestamp(DateTimeOffset.MinValue)
.WithTimestamp(DateTimeOffset.MinValue)
.WithTitle("This is the title")
.WithTitle("This is the title")
.WithUrl(u rl)
.WithUrl(U rl)
.AddField("Field 1", "Inline", true)
.AddField("Field 1", "Inline", true)
.AddField("Field 2", "Not Inline", false);
.AddField("Field 2", "Not Inline", false);
Assert.Equal(100, e.Length);
Assert.Equal(100, e.Length);
@@ -263,11 +263,11 @@ namespace Discord
var e = new EmbedBuilder()
var e = new EmbedBuilder()
.WithFooter(x =>
.WithFooter(x =>
{
{
x.IconUrl = u rl;
x.Text = n ame;
x.IconUrl = U rl;
x.Text = N ame;
});
});
Assert.Equal(u rl, e.Footer.IconUrl);
Assert.Equal(n ame, e.Footer.Text);
Assert.Equal(U rl, e.Footer.IconUrl);
Assert.Equal(N ame, e.Footer.Text);
}
}
/// <summary>
/// <summary>
@@ -278,13 +278,13 @@ namespace Discord
{
{
var footer = new EmbedFooterBuilder()
var footer = new EmbedFooterBuilder()
{
{
IconUrl = u rl,
Text = n ame
IconUrl = U rl,
Text = N ame
};
};
var e = new EmbedBuilder()
var e = new EmbedBuilder()
.WithFooter(footer);
.WithFooter(footer);
Assert.Equal(u rl, e.Footer.IconUrl);
Assert.Equal(n ame, e.Footer.Text);
Assert.Equal(U rl, e.Footer.IconUrl);
Assert.Equal(N ame, e.Footer.Text);
// use the property
// use the property
e = new EmbedBuilder
e = new EmbedBuilder
{
{
@@ -301,9 +301,9 @@ namespace Discord
public void WithFooter_Strings()
public void WithFooter_Strings()
{
{
var e = new EmbedBuilder()
var e = new EmbedBuilder()
.WithFooter(name, u rl);
Assert.Equal(u rl, e.Footer.IconUrl);
Assert.Equal(n ame, e.Footer.Text);
.WithFooter(Name, U rl);
Assert.Equal(U rl, e.Footer.IconUrl);
Assert.Equal(N ame, e.Footer.Text);
}
}
/// <summary>
/// <summary>
@@ -313,10 +313,10 @@ namespace Discord
public void EmbedFooterBuilder()
public void EmbedFooterBuilder()
{
{
var footer = new EmbedFooterBuilder()
var footer = new EmbedFooterBuilder()
.WithIconUrl(u rl)
.WithText(n ame);
Assert.Equal(u rl, footer.IconUrl);
Assert.Equal(n ame, footer.Text);
.WithIconUrl(U rl)
.WithText(N ame);
Assert.Equal(U rl, footer.IconUrl);
Assert.Equal(N ame, footer.Text);
}
}
/// <summary>
/// <summary>
/// Tests that invalid text throws an <see cref="ArgumentException"/>.
/// Tests that invalid text throws an <see cref="ArgumentException"/>.