testing view models

This commit is contained in:
2023-01-18 20:31:50 -07:00
parent 530613fca3
commit 4a321ffa4a
7 changed files with 118 additions and 28 deletions

View File

@@ -80,4 +80,18 @@ public class SemesterPlannerTests
semester.Months.Last().Month.Should().Be(1);
semester.Months.Last().Year.Should().Be(2023);
}
[Test]
public void TestSemesterTracksDaysOfWeek()
{
DayOfWeek[] days = new DayOfWeek[] { DayOfWeek.Monday };
var config = new SemesterConfiguration(
StartDate: new DateTime(2022, 12, 1),
EndDate: new DateTime(2023, 1, 1),
days
);
var semester = new SemesterPlanner(config);
semester.Days.Should().BeEquivalentTo(days);
}
}

View File

@@ -21,6 +21,7 @@
<ItemGroup>
<ProjectReference Include="..\Management\Management.csproj" />
<ProjectReference Include="..\Management.Web\Management.Web.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,14 @@
using Management.Web.Shared.Semester;
public class MonthDetailTests
{
[Test]
public void TestCanGetMonthName()
{
var detail = new MonthDetail();
var calendarMonth = new CalendarMonth(2022, 2);
detail.Month = calendarMonth;
detail.MonthName.Should().Be("February");
}
}