From 746770d52dc74ec24733dd4b0c74257d2e5e57e7 Mon Sep 17 00:00:00 2001 From: Bruce Tian Date: Thu, 15 Feb 2024 23:56:12 +0800 Subject: [PATCH] feat: adding unit test for TusHeader --- src/BirdMessenger.Test/TusHeadersTest.cs | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/BirdMessenger.Test/TusHeadersTest.cs diff --git a/src/BirdMessenger.Test/TusHeadersTest.cs b/src/BirdMessenger.Test/TusHeadersTest.cs new file mode 100644 index 0000000..a916156 --- /dev/null +++ b/src/BirdMessenger.Test/TusHeadersTest.cs @@ -0,0 +1,31 @@ +using Xunit; + +namespace BirdMessenger.Test; + +public class TusHeadersTest +{ + [Theory] + [InlineData(null,false)] + [InlineData("",false)] + [InlineData(" ",false)] + [InlineData("test",false)] + [InlineData(TusHeaders.TusResumable,true)] + [InlineData(TusHeaders.UploadLength,true)] + [InlineData(TusHeaders.UploadOffset,true)] + [InlineData(TusHeaders.UploadMetadata,true)] + [InlineData(TusHeaders.Location,true)] + [InlineData(TusHeaders.UploadDeferLength,true)] + [InlineData(TusHeaders.ContentType,true)] + [InlineData(TusHeaders.UploadChecksum,true)] + [InlineData(TusHeaders.UploadConcat,true)] + [InlineData(TusHeaders.UploadContentTypeValue,true)] + [InlineData(TusHeaders.TusVersion,true)] + [InlineData(TusHeaders.TusMaxSize,true)] + [InlineData(TusHeaders.TusExtension,true)] + public void TestReservedWordsTest(string header, bool isReserved) + { + bool isReservedTest = TusHeaders.IsReserved(header); + + Assert.Equal(isReserved,isReservedTest); + } +} \ No newline at end of file