- adds GitRepoRegistration cmdlets - adds basic tests for GitRepoRegistration implementations - adds initial build project and scripts Refs: #5, #6
48 lines
No EOL
1.4 KiB
C#
48 lines
No EOL
1.4 KiB
C#
using ModuleCore.Calendar;
|
|
using ModuleTests.Calendar.TestData;
|
|
using System.Globalization;
|
|
|
|
namespace ModuleTests.Calendar;
|
|
|
|
public class BasicRenderTest
|
|
{
|
|
private static readonly VerifySettings Settings;
|
|
|
|
static BasicRenderTest()
|
|
{
|
|
Settings = new VerifySettings();
|
|
var testBaseDirectory = Path.Join(TestConstants.SnapshotFolderName, nameof(BasicRenderTest));
|
|
|
|
Settings.UseDirectory(testBaseDirectory);
|
|
Settings.DisableDiff();
|
|
}
|
|
|
|
[Theory]
|
|
[ClassData(typeof(CalendarTestDates))]
|
|
public Task BasicCalendarRender(DateTime month)
|
|
{
|
|
Settings.UseFileName($"{month:yyyy-MM-dd}");
|
|
|
|
var calendar = new CalendarGenerator();
|
|
// Render the calendar with the start of the month as the today date so no elapsed marks are shown
|
|
var renderedMonth = calendar.Render(month, new DateTime(month.Year, month.Month, 1));
|
|
|
|
return Verify(renderedMonth, Settings);
|
|
}
|
|
|
|
[Theory]
|
|
[ClassData(typeof(CultureCodeTestData))]
|
|
public Task CultureInfoCalendarRender(string cultureCode)
|
|
{
|
|
Settings.UseFileName($"{cultureCode}");
|
|
|
|
Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureCode);
|
|
|
|
var month = new DateTime(2026, 8, 1);
|
|
var calendar = new CalendarGenerator();
|
|
// Render the calendar with the start of the month as the today date so no elapsed marks are shown
|
|
var renderedMonth = calendar.Render(month, new DateTime(month.Year, month.Month, 1));
|
|
|
|
return Verify(renderedMonth, Settings);
|
|
}
|
|
} |