Fix ChannelPermissions Modify parameter to be correct default value (#1003)
* fix channel permissions modify parameter to use nullable boolean, correct default value * Add general tests for the ChannelPermissions.Modify method to test default values * remove unused cast in tests * add guildpermission modify no param tests * Add no-param modify tests for OverwritePermissions * fix inconsistent parameters in GuildPermissions cstr * Adjust formatting of methods and cstrs with many parameters * remove temp file that was included. no idea what that is * Fix System dependency I should really stop fixing merge conflicts in the github website.
This commit is contained in:
committed by
Christopher F
parent
f9cbff5e42
commit
a06e21261c
@@ -22,6 +22,27 @@ namespace Discord
|
||||
var copy = perm.Modify();
|
||||
Assert.Equal((ulong)0, copy.RawValue);
|
||||
|
||||
// test modify with no parameters after using all
|
||||
copy = ChannelPermissions.Text;
|
||||
var modified = copy.Modify(); // no params should not change the result
|
||||
Assert.Equal(ChannelPermissions.Text.RawValue, modified.RawValue);
|
||||
|
||||
copy = ChannelPermissions.Voice;
|
||||
modified = copy.Modify(); // no params should not change the result
|
||||
Assert.Equal(ChannelPermissions.Voice.RawValue, modified.RawValue);
|
||||
|
||||
copy = ChannelPermissions.Group;
|
||||
modified = copy.Modify(); // no params should not change the result
|
||||
Assert.Equal(ChannelPermissions.Group.RawValue, modified.RawValue);
|
||||
|
||||
copy = ChannelPermissions.DM;
|
||||
modified = copy.Modify(); // no params should not change the result
|
||||
Assert.Equal(ChannelPermissions.DM.RawValue, modified.RawValue);
|
||||
|
||||
copy = new ChannelPermissions(useExternalEmojis: true);
|
||||
modified = copy.Modify();
|
||||
Assert.Equal(copy.RawValue, modified.RawValue);
|
||||
|
||||
// test the values that are returned by ChannelPermission.All
|
||||
Assert.Equal((ulong)0, ChannelPermissions.None.RawValue);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user