mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 09:11:10 +00:00
Renames project paths from Lumina to Nemera
This commit is contained in:
1 parent
ce6fddb4c9
commit
0f659a4877
6450 files changed
No files matched your search
+94
@@ -0,0 +1,94 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Themes;
|
||||
using Lumina.Application.Common.Mapping.Themes;
|
||||
using Lumina.Application.Fixtures.Common.DataAccess.Entities.Themes;
|
||||
using Lumina.Contracts.Responses.Themes;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Themes;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="ThemeEntityMapping"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ThemeEntityMappingTests
|
||||
{
|
||||
private readonly ThemeEntityFixture _themeEntityFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ToResponse_WhenMappingValidThemeEntity_ShouldMapAllFields()
|
||||
{
|
||||
// Arrange
|
||||
ThemeEntity theme = _themeEntityFixture.Create(
|
||||
themeId: "my-theme",
|
||||
name: "My Theme",
|
||||
description: "A nice theme",
|
||||
author: "Jane Doe",
|
||||
version: "1.2.3",
|
||||
previewPath: "preview.png",
|
||||
installSource: ThemeInstallSource.Bundled,
|
||||
isCurrent: true,
|
||||
isDeleted: false);
|
||||
|
||||
// Act
|
||||
ThemeResponse result = theme.ToResponse();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(result);
|
||||
Assert.Equal(theme.Id, result.Id);
|
||||
Assert.Equal(theme.ThemeId, result.ThemeId);
|
||||
Assert.Equal(theme.Name, result.Name);
|
||||
Assert.Equal(theme.Description, result.Description);
|
||||
Assert.Equal(theme.Author, result.Author);
|
||||
Assert.Equal(theme.Version, result.Version);
|
||||
Assert.Equal(theme.PreviewPath, result.PreviewPath);
|
||||
Assert.Equal(theme.InstallSource, result.InstallSource);
|
||||
Assert.Equal(theme.IsCurrent, result.IsCurrent);
|
||||
Assert.Equal(theme.InstalledAtUtc, result.InstalledAtUtc);
|
||||
Assert.Equal(theme.IsDeleted, result.IsDeleted);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToResponse_WhenPreviewPathIsNull_ShouldMapNullPreviewPath()
|
||||
{
|
||||
// Arrange
|
||||
ThemeEntity theme = _themeEntityFixture.Create();
|
||||
theme.PreviewPath = null;
|
||||
|
||||
// Act
|
||||
ThemeResponse result = theme.ToResponse();
|
||||
|
||||
// Assert
|
||||
Assert.Null(result.PreviewPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToResponse_WhenIsCurrentIsNull_ShouldMapNullIsCurrent()
|
||||
{
|
||||
// Arrange
|
||||
ThemeEntity theme = _themeEntityFixture.Create();
|
||||
theme.IsCurrent = null;
|
||||
|
||||
// Act
|
||||
ThemeResponse result = theme.ToResponse();
|
||||
|
||||
// Assert
|
||||
Assert.Null(result.IsCurrent);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToResponse_WhenMappingUploadedTheme_ShouldMapInstallSourceAsUploaded()
|
||||
{
|
||||
// Arrange
|
||||
ThemeEntity theme = _themeEntityFixture.Create(installSource: ThemeInstallSource.Uploaded, isCurrent: null);
|
||||
|
||||
// Act
|
||||
ThemeResponse result = theme.ToResponse();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(ThemeInstallSource.Uploaded, result.InstallSource);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user