mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
// ==========================================================================
|
|
// FileExtensionsTests.cs
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using Xunit;
|
|
|
|
namespace Squidex.Infrastructure
|
|
{
|
|
public class FileExtensionsTests
|
|
{
|
|
[Theory]
|
|
[InlineData("test.mp4", "mp4")]
|
|
[InlineData("test.MP4", "mp4")]
|
|
[InlineData("test.txt", "txt")]
|
|
[InlineData("test.TXT", "txt")]
|
|
public void Should_calculate_file_type(string fileName, string expected)
|
|
{
|
|
var actual = fileName.FileType();
|
|
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("")]
|
|
[InlineData(" ")]
|
|
[InlineData(null)]
|
|
public void Should_blob_for_invalid_file_types(string fileName)
|
|
{
|
|
var actual = fileName.FileType();
|
|
|
|
Assert.Equal("blob", actual);
|
|
}
|
|
}
|
|
}
|
|
|