Files
Musify/backend/Tests/Musify.Application.Tests/Shared/StorageKeyTests.cs
T
Admin b5700614c1 Use block-scoped namespaces in the test suite
Converts all 73 test source files from file-scoped (namespace X;) to
block-scoped (namespace X { ... }) declarations, re-indenting their
contents accordingly. Matches the existing convention already used in
several production files (e.g. Musify.Infrastructure.Configuration,
Musify.Application.Contracts).

Mechanical change only, done with a script, verified with a full
rebuild (0 warnings, 0 errors) and test run (257/257 passing).
2026-09-09 23:09:43 +02:00

42 lines
1.1 KiB
C#

using Musify.Application.Shared;
using Xunit;
namespace Musify.Application.Tests.Shared
{
public sealed class StorageKeyTests
{
[Fact]
public void Combine_MultipleSegments_JoinsThemWithForwardSlashes()
{
var key = StorageKey.Combine("Tracks", "SmallPictures", "cover.webp");
Assert.Equal("Tracks/SmallPictures/cover.webp", key);
}
[Fact]
public void Combine_SegmentsWithSurroundingSlashesAndWhitespace_TrimsThem()
{
var key = StorageKey.Combine(" Tracks/ ", "/SmallPictures/", "cover.webp");
Assert.Equal("Tracks/SmallPictures/cover.webp", key);
}
[Theory]
[InlineData(null)]
[InlineData("")]
[InlineData(" ")]
public void Combine_BlankSegment_IsSkipped(string? blank)
{
var key = StorageKey.Combine("Tracks", blank!, "cover.webp");
Assert.Equal("Tracks/cover.webp", key);
}
[Fact]
public void Combine_NoSegments_ReturnsEmptyString()
{
Assert.Equal(string.Empty, StorageKey.Combine());
}
}
}