Files

28 lines
790 B
C#

using Elternbeirat.Web.Features.Layout;
namespace Elternbeirat.Web.Tests;
/// <summary>
/// Unit tests for the footer's copyright year. Pure logic, no PocketBase needed.
/// </summary>
public class FooterYearTests
{
[Fact]
public void New_year_in_Berlin_wins_over_the_UTC_year()
{
// 23:30 UTC on New Year's Eve is already 00:30 in Berlin (winter time, +1),
// so the footer must show the new year although the server clock says the old.
var now = new DateTimeOffset(2026, 12, 31, 23, 30, 0, TimeSpan.Zero);
FooterYear.For(now).ShouldBe(2027);
}
[Fact]
public void Ordinary_day_keeps_its_year()
{
var now = new DateTimeOffset(2026, 10, 1, 12, 0, 0, TimeSpan.Zero);
FooterYear.For(now).ShouldBe(2026);
}
}