public async Task MemberClient_RemovePoints_ToUserThatExistsWithNegativeSubstractionResult_ReturnsZero() { // arrange const int addAmount = 5; const int removeAmount = 8; var channel = GetChannel(); var client = new Member.MemberClient(channel); const string guildId = "1"; const string userId = "1"; var addQuery = new MemberQueryWithPoints { GuildId = guildId, UserId = userId, Amount = addAmount }; var removeQuery = new MemberQueryWithPoints { GuildId = guildId, UserId = userId, Amount = removeAmount }; // act var addResult = await client.AddPointsAsync(addQuery); var removeResult = await client.RemovePointsAsync(removeQuery); // assert Assert.AreEqual(Status.Success, addResult.Status, "AddPointsAsync() failed."); Assert.AreEqual(addAmount, addResult.Experience); Assert.AreEqual(Status.Success, removeResult.Status, "RemovePointsAsync() failed."); Assert.AreEqual(0, removeResult.Experience); }
public async Task MemberClient_RemovePoints_ToUserThatDoesNotExist_ReturnsZero() { // arrange var amount = Rng.Next(); var channel = GetChannel(); var client = new Member.MemberClient(channel); const string guildId = "1"; const string userId = "1"; var query = new MemberQueryWithPoints { GuildId = guildId, UserId = userId, Amount = amount }; // act var result = await client.RemovePointsAsync(query); // assert Assert.AreEqual(Status.Success, result.Status, "RemovePointsAsync() failed."); Assert.AreEqual(0, result.Experience); }