public void NextMonthCommand_MonthChangedAndEventRised(
            DateTime original,
            DateTime expected,
            int runCommandTime)
        {
            Mock<IDateTimeService> dateTime = new Mock<IDateTimeService>();
            dateTime.Setup(x => x.Now).Returns(original);
            var actualEventsAmount = 0;
            var lastMonthFromEvent = 0;
            var lastYearFromEvent = 0;

            var target = new MonthPickerViewModel(dateTime.Object);
            target.MonthChanged += (sender, args) =>
            {
                actualEventsAmount++;
                lastMonthFromEvent = args.NewMonth.Month;
                lastYearFromEvent = args.NewMonth.Year;
            };

            for (int i = 0; i < runCommandTime; i++)
            {
                target.NextMonthCommand.Execute(null);
            }

            Assert.Equal(expected.Month, target.CurrentDate.Month);
            Assert.Equal(expected.Year, target.CurrentDate.Year);
            Assert.Equal(runCommandTime, actualEventsAmount);
            Assert.Equal(expected.Month, lastMonthFromEvent);
            Assert.Equal(expected.Year, lastYearFromEvent);
        }
        public void Ctor_CurrentDateSet(Mock<IDateTimeService> dateTime)
        {
            var currentDate = DateTime.Now;
            dateTime.Setup(x => x.Now).Returns(currentDate);

            var target = new MonthPickerViewModel(dateTime.Object);

            Assert.Equal(currentDate.Month, target.CurrentDate.Month);
            Assert.Equal(currentDate.ToString("MMMM"), target.CurrentDate.ToString("MMMM"));
            Assert.Equal(currentDate.Year, target.CurrentDate.Year);
        }
        public void NextMonthCommand_MaximumYear_StayOnMaximum()
        {
            Mock<IDateTimeService> dateTime = new Mock<IDateTimeService>();
            dateTime.Setup(x => x.Now).Returns(DateTime.MaxValue);
            var actualEventsAmount = 0;
            var target = new MonthPickerViewModel(dateTime.Object);
            target.MonthChanged += (sender, args) =>
            {
                actualEventsAmount++;
            };

            target.NextMonthCommand.Execute(null);

            Assert.Equal(DateTime.MaxValue.Month, target.CurrentDate.Month);
            Assert.Equal(DateTime.MaxValue.Year, target.CurrentDate.Year);
            Assert.Equal(0, actualEventsAmount);
        }