From 2ddd28a40b6613be56e92ac75742922ed403630a Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Sun, 30 Sep 2018 17:03:16 -0700 Subject: [PATCH] Add a test for ExplicitContentFilterLevel modification behavior --- test/Discord.Net.Tests/Tests.Guilds.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/test/Discord.Net.Tests/Tests.Guilds.cs b/test/Discord.Net.Tests/Tests.Guilds.cs index b0a6922b0..637aac9e8 100644 --- a/test/Discord.Net.Tests/Tests.Guilds.cs +++ b/test/Discord.Net.Tests/Tests.Guilds.cs @@ -5,8 +5,27 @@ using Xunit; namespace Discord { - public class GuildTests + public partial class Tests { + /// + /// Tests the behavior of modifying the ExplicitContentFilter property of a Guild. + /// + [Fact] + public async Task TestExplicitContentFilter() + { + async Task ModifyAndAssert(ExplicitContentFilterLevel level) + { + await _guild.ModifyAsync(x => x.ExplicitContentFilter = level); + Assert.Equal(level, _guild.ExplicitContentFilter); + } + + foreach (var level in Enum.GetValues(typeof(ExplicitContentFilterLevel))) + await ModifyAndAssert((ExplicitContentFilterLevel)level); + } + + /// + /// Tests the behavior of the GuildPermissions class. + /// [Fact] public Task TestGuildPermission() {