Add project reference for TeleWave.Infrastructure: include TeleWave.Infrastructure.csproj in TeleWave.Application.Tests project to support additional testing capabilities.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using TeleWave.Domain.Images;
|
||||
using Xunit;
|
||||
|
||||
namespace TeleWave.Domain.Tests.Images;
|
||||
|
||||
public class ImageTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("jpg", ".jpg")]
|
||||
[InlineData(".PNG", ".png")]
|
||||
[InlineData(" .WebP ", ".webp")]
|
||||
public void Create_NormalizesExtension(string input, string expected)
|
||||
{
|
||||
var img = Image.Create(ImageCategory.ShowPoster, input, "poster.jpg");
|
||||
|
||||
Assert.Equal(expected, img.FileExtension);
|
||||
Assert.Equal(ImageCategory.ShowPoster, img.Category);
|
||||
Assert.Equal("poster.jpg", img.OriginalFileName);
|
||||
Assert.NotEqual(Guid.Empty, img.Id);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_BlankFileName_BecomesNull()
|
||||
{
|
||||
var img = Image.Create(ImageCategory.Library, ".jpg", " ");
|
||||
Assert.Null(img.OriginalFileName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user