Skip to content

Commit

Permalink
add tests for InviteWithMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
starshine-sys committed Aug 19, 2024
1 parent 75af1ef commit b1f5b21
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// InviteWithMetadataTests.cs
//
// Author:
// Jarl Gullberg <[email protected]>
//
// Copyright (c) Jarl Gullberg
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

using Remora.Discord.API.Abstractions.Objects;
using Remora.Discord.API.Tests.TestBases;

namespace Remora.Discord.API.Tests.Objects;

/// <inheritdoc />
public class InviteWithMetadataTests : ObjectTestBase<IInviteWithMetadata>
{
/// <summary>
/// Initializes a new instance of the <see cref="InviteWithMetadataTests"/> class.
/// </summary>
/// <param name="fixture">The test fixture.</param>
public InviteWithMetadataTests(JsonBackedTypeTestFixture fixture)
: base(fixture)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"code": "123456",
"guild": { },
"channel": { },
"inviter": {
"username": "none",
"discriminator": "9999",
"id": "999999999999999999",
"avatar": "68b329da9893e34099c7d8ad5cb9c940"
},
"target_type": 1,
"target_user": {
"username": "none",
"discriminator": "9999",
"id": "999999999999999999",
"avatar": "68b329da9893e34099c7d8ad5cb9c940"
},
"target_application": {
"id": "999999999999999999",
"name": "none",
"icon": "68b329da9893e34099c7d8ad5cb9c940",
"description": "none",
"bot_public": true,
"bot_require_code_grant": true,
"verify_key": "none",
"team": {
"icon": "68b329da9893e34099c7d8ad5cb9c940",
"id": "999999999999999999",
"members": [
{
"membership_state": 2,
"permissions": [
"*"
],
"team_id": "999999999999999999",
"user": {
"avatar": "68b329da9893e34099c7d8ad5cb9c940",
"discriminator": "9999",
"id": "999999999999999999",
"username": "none"
},
"role": "read_only"
}
],
"name": "none",
"owner_user_id": "999999999999999999"
}
},
"approximate_presence_count": 1,
"approximate_member_count": 1,
"expires_at": "1970-01-01T00:00:00.000000+00:00",
"guild_scheduled_event": {
"id": "999999999999999999",
"guild_id": "999999999999999999",
"channel_id": "999999999999999999",
"name": "none",
"scheduled_start_time": "1970-01-01T00:00:00.000000+00:00",
"scheduled_end_time": "1970-01-01T00:00:00.000000+00:00",
"privacy_level": 1,
"status": 1,
"entity_type": 1,
"entity_id": "999999999999999999",
"entity_metadata": { }
},
"uses": 1,
"max_uses": 1,
"max_age": 86400,
"temporary": true,
"created_at": "1970-01-01T00:00:00.000000+00:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"code": "123456",
"guild": { },
"channel": null,
"inviter": {
"username": "none",
"discriminator": "9999",
"id": "999999999999999999",
"avatar": "68b329da9893e34099c7d8ad5cb9c940"
},
"target_type": 1,
"target_user": {
"username": "none",
"discriminator": "9999",
"id": "999999999999999999",
"avatar": "68b329da9893e34099c7d8ad5cb9c940"
},
"target_application": {
"id": "999999999999999999",
"name": "none",
"icon": "68b329da9893e34099c7d8ad5cb9c940",
"description": "none",
"bot_public": true,
"bot_require_code_grant": true,
"verify_key": "none",
"team": {
"icon": "68b329da9893e34099c7d8ad5cb9c940",
"id": "999999999999999999",
"members": [
{
"membership_state": 2,
"permissions": [
"*"
],
"team_id": "999999999999999999",
"user": {
"avatar": "68b329da9893e34099c7d8ad5cb9c940",
"discriminator": "9999",
"id": "999999999999999999",
"username": "none"
},
"role": "read_only"
}
],
"name": "none",
"owner_user_id": "999999999999999999"
}
},
"approximate_presence_count": 1,
"approximate_member_count": 1,
"expires_at": null,
"guild_scheduled_event": {
"id": "999999999999999999",
"guild_id": "999999999999999999",
"channel_id": "999999999999999999",
"name": "none",
"scheduled_start_time": "1970-01-01T00:00:00.000000+00:00",
"scheduled_end_time": "1970-01-01T00:00:00.000000+00:00",
"privacy_level": 1,
"status": 1,
"entity_type": 1,
"entity_id": "999999999999999999",
"entity_metadata": { }
},
"uses": 1,
"max_uses": 1,
"max_age": 86400,
"temporary": true,
"created_at": "1970-01-01T00:00:00.000000+00:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"code": "123456",
"channel": { },
"uses": 1,
"max_uses": 1,
"max_age": 86400,
"temporary": true,
"created_at": "1970-01-01T00:00:00.000000+00:00"
}

0 comments on commit b1f5b21

Please sign in to comment.