41 lines
1.6 KiB
C#
41 lines
1.6 KiB
C#
using MeetTheTeacher.Import;
|
|
using MeetTheTeacher.Model;
|
|
|
|
namespace MeetTheTeacher.Test.Import;
|
|
|
|
// such a class would rarely exist in production code
|
|
// so this test is rather silly - doing it for completeness anyway
|
|
public sealed class TeacherDataFakeImporterTests
|
|
{
|
|
private readonly TeacherDataFakeImporter _teacherDataFakeImporter;
|
|
|
|
public TeacherDataFakeImporterTests()
|
|
{
|
|
_teacherDataFakeImporter = new TeacherDataFakeImporter();
|
|
}
|
|
|
|
[Fact]
|
|
public void LoadTeacherData_ReturnsExpectedData()
|
|
{
|
|
var result = _teacherDataFakeImporter.LoadTeacherData().ToList();
|
|
|
|
result.Should().HaveCount(6);
|
|
result[0].Name.Should().Be("John Doe");
|
|
result[0].ConsultingHour.Should().Be(new TimeFrame(new TimeOnly(8, 0), new TimeOnly(8, 50)));
|
|
result[0].ConsultingHourUnit.Should().Be(SchoolUnit.UE01);
|
|
result[0].ConsultingHourWeekDay.Should().Be(DayOfWeek.Monday);
|
|
result[0].Room.Should().Be("A101");
|
|
|
|
// Add similar assertions for the other Teacher instances
|
|
|
|
result[4].Name.Should().Be("Emily Davis");
|
|
result[4].ConsultingHour.Should().Be(new TimeFrame(new TimeOnly(12, 40), new TimeOnly(13, 35)));
|
|
result[4].ConsultingHourUnit.Should().Be(SchoolUnit.UE06);
|
|
result[4].ConsultingHourWeekDay.Should().Be(DayOfWeek.Thursday);
|
|
result[4].Room.Should().Be("A101");
|
|
result[4].Should().BeOfType<TeacherWithBusinessCard>();
|
|
((TeacherWithBusinessCard) result[4]).Id.Should().Be(1001);
|
|
|
|
// Add similar assertions for the other TeacherWithBusinessCard instances
|
|
}
|
|
}
|