Skip to content

Commit

Permalink
feat: adding unit test for TusHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetianx committed Feb 15, 2024
1 parent 421f815 commit 746770d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/BirdMessenger.Test/TusHeadersTest.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 746770d

Please sign in to comment.