GetHalfyears() public method

public GetHalfyears ( ) : IEnumerable
return IEnumerable
        public void SingleHalfyearsTest() {
            const int startYear = 2004;
            const HalfyearKind startHalfyear = HalfyearKind.Second;
            var halfyears = new HalfyearRangeCollection(startYear, startHalfyear, 1);

            halfyears.YearBaseMonth.Should().Be(1);
            halfyears.HalfyearCount.Should().Be(1);
            halfyears.StartHalfyear.Should().Be(startHalfyear);
            halfyears.StartYear.Should().Be(startYear);
            halfyears.EndYear.Should().Be(startYear);
            halfyears.EndHalfyear.Should().Be(HalfyearKind.Second);

            var halfyearList = halfyears.GetHalfyears().ToList();

            halfyearList.Count.Should().Be(1);
            halfyearList[0].IsSamePeriod(new HalfyearRange(2004, HalfyearKind.Second)).Should().Be.True();
        }
Exemplo n.º 2
0
        public void SingleHalfyearsTest()
        {
            const int          startYear     = 2004;
            const HalfyearKind startHalfyear = HalfyearKind.Second;
            var halfyears = new HalfyearRangeCollection(startYear, startHalfyear, 1);

            halfyears.YearBaseMonth.Should().Be(1);
            halfyears.HalfyearCount.Should().Be(1);
            halfyears.StartHalfyear.Should().Be(startHalfyear);
            halfyears.StartYear.Should().Be(startYear);
            halfyears.EndYear.Should().Be(startYear);
            halfyears.EndHalfyear.Should().Be(HalfyearKind.Second);

            var halfyearList = halfyears.GetHalfyears().ToList();

            halfyearList.Count.Should().Be(1);
            halfyearList[0].IsSamePeriod(new HalfyearRange(2004, HalfyearKind.Second)).Should().Be.True();
        }
        public void SecondCalendarHalfyearsTest() {
            const int startYear = 2004;
            const HalfyearKind startHalfyear = HalfyearKind.Second;
            const int halfyearCount = 3;
            var halfyears = new HalfyearRangeCollection(startYear, startHalfyear, halfyearCount);

            halfyears.YearBaseMonth.Should().Be(1);
            halfyears.HalfyearCount.Should().Be(halfyearCount);
            halfyears.StartHalfyear.Should().Be(startHalfyear);
            halfyears.StartYear.Should().Be(startYear);
            halfyears.EndYear.Should().Be(2005);
            halfyears.EndHalfyear.Should().Be(HalfyearKind.Second);

            var halfyearList = halfyears.GetHalfyears().ToList();

            halfyearList.Count.Should().Be(halfyearCount);
            Assert.IsTrue(halfyearList[0].IsSamePeriod(new HalfyearRange(2004, HalfyearKind.Second)));
            Assert.IsTrue(halfyearList[1].IsSamePeriod(new HalfyearRange(2005, HalfyearKind.First)));
            Assert.IsTrue(halfyearList[2].IsSamePeriod(new HalfyearRange(2005, HalfyearKind.Second)));
        }
Exemplo n.º 4
0
        public void SecondCalendarHalfyearsTest()
        {
            const int          startYear     = 2004;
            const HalfyearKind startHalfyear = HalfyearKind.Second;
            const int          halfyearCount = 3;
            var halfyears = new HalfyearRangeCollection(startYear, startHalfyear, halfyearCount);

            halfyears.YearBaseMonth.Should().Be(1);
            halfyears.HalfyearCount.Should().Be(halfyearCount);
            halfyears.StartHalfyear.Should().Be(startHalfyear);
            halfyears.StartYear.Should().Be(startYear);
            halfyears.EndYear.Should().Be(2005);
            halfyears.EndHalfyear.Should().Be(HalfyearKind.Second);

            var halfyearList = halfyears.GetHalfyears().ToList();

            halfyearList.Count.Should().Be(halfyearCount);
            Assert.IsTrue(halfyearList[0].IsSamePeriod(new HalfyearRange(2004, HalfyearKind.Second)));
            Assert.IsTrue(halfyearList[1].IsSamePeriod(new HalfyearRange(2005, HalfyearKind.First)));
            Assert.IsTrue(halfyearList[2].IsSamePeriod(new HalfyearRange(2005, HalfyearKind.Second)));
        }