Skip to content

Commit

Permalink
Test to cover case where fileextension not found in map
Browse files Browse the repository at this point in the history
  • Loading branch information
tjololo committed Aug 26, 2023
1 parent a5ce17c commit 91e84a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/Altinn.App.Core.Tests/Helpers/MimeTypeMapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,11 @@ public void GetMimeType_throws_ArgumentNullException_if_extension_null()
Action act = () => MimeTypeMap.GetMimeType(null);
act.Should().Throw<ArgumentNullException>();
}

[Fact]
public void GetMimeType_returns_octetstream_for_unknown_fileextension()
{
var mimetype = MimeTypeMap.GetMimeType(".unknown");
mimetype.Should().BeEquivalentTo(new MimeType("application/octet-stream"));
}
}

0 comments on commit 91e84a7

Please sign in to comment.