public static void GetUnitsToDate___Should_throw_ArgumentNullException___When_parameter_lastUnitOfTimeInYear_is_null()
        {
            // Arrange, Act
            var ex1 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <CalendarDay>(null));
            var ex2 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <CalendarMonth>(null));
            var ex3 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <CalendarQuarter>(null));
            var ex4 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <CalendarYear>(null));

            var ex5 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <FiscalMonth>(null));
            var ex6 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <FiscalQuarter>(null));
            var ex7 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <FiscalYear>(null));

            var ex8  = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <GenericMonth>(null));
            var ex9  = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <GenericQuarter>(null));
            var ex10 = Record.Exception(() => UnitOfTimeExtensions.GetUnitsToDate <GenericYear>(null));

            // Assert
            ex1.Should().BeOfType <ArgumentNullException>();
            ex2.Should().BeOfType <ArgumentNullException>();
            ex3.Should().BeOfType <ArgumentNullException>();
            ex4.Should().BeOfType <ArgumentNullException>();
            ex5.Should().BeOfType <ArgumentNullException>();
            ex6.Should().BeOfType <ArgumentNullException>();
            ex7.Should().BeOfType <ArgumentNullException>();
            ex8.Should().BeOfType <ArgumentNullException>();
            ex9.Should().BeOfType <ArgumentNullException>();
            ex10.Should().BeOfType <ArgumentNullException>();
        }
        public static void GetFirstCalendarDay___Should_throw_ArgumentNullException___When_parameter_unitOfTime_is_null()
        {
            // Arrange, Act
            var ex = Record.Exception(() => UnitOfTimeExtensions.GetFirstCalendarDay(null));

            // Assert
            ex.Should().BeOfType <ArgumentNullException>();
        }
Exemplo n.º 3
0
        public static void ToFiscalQuarter___Should_throw_ArgumentNullException___When_parameter_calendarQuarter_is_null()
        {
            // Arrange, Act
            var ex = Record.Exception(() => UnitOfTimeExtensions.ToFiscalQuarter(null, A.Dummy <QuarterNumber>()));

            // Assert
            ex.Should().BeOfType <ArgumentNullException>();
        }
Exemplo n.º 4
0
        public static void ToReportingPeriod___Should_throw_ArgumentNullException___When_parameter_unitOfTime_is_null()
        {
            // Arrange, Act
            var ex = Record.Exception(() => UnitOfTimeExtensions.ToReportingPeriod(null));

            // Assert
            ex.Should().BeOfType <ArgumentNullException>();
        }
Exemplo n.º 5
0
        public static void ToGenericMonth___Should_throw_ArgumentNullException___When_parameter_month_is_null()
        {
            // Arrange, Act
            var ex = Record.Exception(() => UnitOfTimeExtensions.ToGenericMonth(null));

            // Assert
            ex.Should().BeOfType <ArgumentNullException>();
        }
        public static void SerializeToSortableString___Should_throw_ArgumentNullException___When_parameter_unitOfTime_is_null()
        {
            // Arrange, Act
            var ex = Record.Exception(() => UnitOfTimeExtensions.SerializeToSortableString(null));

            // Assert
            ex.Should().BeOfType <ArgumentNullException>();
        }