public HasPermissionAsync() { _discordGuild = MockHelper.CreateDiscordGuild(0, 1); _discordRole = MockHelper.CreateDiscordRole(0); var mock = new Mock <IGuildUser>(); mock.Setup(u => u.Id).Returns(0); mock.Setup(u => u.RoleIds).Returns(new List <ulong> { _discordRole.Id }); _discordUser = mock.Object; var ownerMock = new Mock <IGuildUser>(); ownerMock.Setup(u => u.Id).Returns(1); ownerMock.Setup(u => u.RoleIds).Returns(new List <ulong> { _discordRole.Id }); _discordGuildOwner = ownerMock.Object; _permission = new TestPermission(); }
public override async Task InitializeAsync() { var guild = MockHelper.CreateDiscordGuild(0); var discordRole = MockHelper.CreateDiscordRole(1, guild); var result = await this.Characters.CreateCharacterRoleAsync ( discordRole, RoleAccess.Open ); _role = result.Entity; }
public override async Task InitializeAsync() { var user = (await this.Users.GetOrRegisterUserAsync(_owner)).Entity; _character = new Character((long)_guild.Id, user, CharacterName); this.Database.Characters.Update(_character); var createRoleResult = await this.Characters.CreateCharacterRoleAsync ( MockHelper.CreateDiscordRole(2, _guild), RoleAccess.Open ); _role = createRoleResult.Entity; await this.Database.SaveChangesAsync(); }
public GetCharacterRoleAsync() { _discordGuild = MockHelper.CreateDiscordGuild(0); _discordRole = MockHelper.CreateDiscordRole(1, _discordGuild); _unregisteredDiscordRole = MockHelper.CreateDiscordRole(2, _discordGuild); }
public GrantPermissionToRoleAsync() { _discordRole = MockHelper.CreateDiscordRole(0); _permission = new TestPermission(); }
public CreateCharacterRoleAsync() { _discordGuild = MockHelper.CreateDiscordGuild(0); _discordRole = MockHelper.CreateDiscordRole(1, _discordGuild); }
public RevokePermissionFromRoleAsync() { _discordRole = MockHelper.CreateDiscordRole(0); _permission = new TestPermission(); }
public SetCharacterRoleAccessAsync() { var guild = MockHelper.CreateDiscordGuild(0); _discordRole = MockHelper.CreateDiscordRole(1, guild); }