コード例 #1
0
        public void GenerateCorrectAcademicYears(DateTime today, int expectedCurrentYear, int expectedPreviousYear)
        {
            var model = new AcademicYear(today);

            model.Should().Be((AcademicYear)expectedCurrentYear);
            (model - 1).Should().Be((AcademicYear)expectedPreviousYear);
        }
コード例 #2
0
        public void MapAcademicYear()
        {
            var academicYearLookup = new AcademicYear
            {
                AugustThirtyFirst = new DateTime(2018, 8, 31),
                End             = new DateTime(2019, 7, 31),
                JanuaryFirst    = new DateTime(2019, 1, 1),
                JulyThirtyFirst = new DateTime(2019, 7, 31),
                Start           = new DateTime(2018, 8, 1)
            };

            var expectedAademicYearLookup = new AcademicYear
            {
                AugustThirtyFirst = new DateTime(2018, 8, 31),
                End             = new DateTime(2019, 7, 31),
                JanuaryFirst    = new DateTime(2019, 1, 1),
                JulyThirtyFirst = new DateTime(2019, 7, 31),
                Start           = new DateTime(2018, 8, 1)
            };

            expectedAademicYearLookup.Should().BeEquivalentTo(NewMapper().MapAcademicYear(academicYearLookup));
        }