Make tests more resilient

This commit is contained in:
Tyrrrz
2023-09-28 19:18:52 +03:00
parent c466c17793
commit fbfff4e51f
5 changed files with 32 additions and 15 deletions

View File

@@ -28,9 +28,10 @@ public class JsonAttachmentSpecs
.GetProperty("url")
.GetString()
.Should()
.Be(
.StartWith(
"https://cdn.discordapp.com/attachments/885587741654536192/885587844964417596/Test.txt"
);
attachments[0].GetProperty("fileName").GetString().Should().Be("Test.txt");
attachments[0].GetProperty("fileSizeBytes").GetInt64().Should().Be(11);
}
@@ -54,9 +55,10 @@ public class JsonAttachmentSpecs
.GetProperty("url")
.GetString()
.Should()
.Be(
.StartWith(
"https://cdn.discordapp.com/attachments/885587741654536192/885654862430359613/bird-thumbnail.png"
);
attachments[0].GetProperty("fileName").GetString().Should().Be("bird-thumbnail.png");
attachments[0].GetProperty("fileSizeBytes").GetInt64().Should().Be(466335);
}
@@ -80,14 +82,16 @@ public class JsonAttachmentSpecs
.GetProperty("url")
.GetString()
.Should()
.Be(
.StartWith(
"https://cdn.discordapp.com/attachments/885587741654536192/885655761512968233/file_example_MP4_640_3MG.mp4"
);
attachments[0]
.GetProperty("fileName")
.GetString()
.Should()
.Be("file_example_MP4_640_3MG.mp4");
attachments[0].GetProperty("fileSizeBytes").GetInt64().Should().Be(3114374);
}
@@ -110,9 +114,10 @@ public class JsonAttachmentSpecs
.GetProperty("url")
.GetString()
.Should()
.Be(
.StartWith(
"https://cdn.discordapp.com/attachments/885587741654536192/885656175348187146/file_example_MP3_1MG.mp3"
);
attachments[0].GetProperty("fileName").GetString().Should().Be("file_example_MP3_1MG.mp3");
attachments[0].GetProperty("fileSizeBytes").GetInt64().Should().Be(1087849);
}