public async Task ShouldAddResumedSubcriptionDate_WhenLastSubscriptionDateWasTypeOfStartedAndViceVersa
            (SubscriptionDateType type)
        {
            var today              = DateTime.Today;
            var subscriptionId     = 1;
            var subscriptionDateId = 1;
            SubscriptionDate lastSubscriptionDate = new SubscriptionDate
            {
                Id             = subscriptionDateId,
                SubscriptionId = subscriptionId,
                Type           = type
            };

            SetupMocks(subscriptionId, lastSubscriptionDate);
            var commandContext = new SuspendResumeSubscriptionContext(today);
            var command        = new SuspendResumeSubscriptionCommand(_queryBuilderMock.Object, _commandBuilderMock.Object);

            await command.ExecuteAsync(commandContext);

            var newSubscriptionDateType = lastSubscriptionDate.Type == SubscriptionDateType.Start
                    ? SubscriptionDateType.Suspend
                    : SubscriptionDateType.Start;

            _commandBuilderMock.Verify(x => x.ExecuteAsync(It.Is <AddSubcriptionDateRepositoryContext>
                                                               (y => y.SubscriptionDate.SubscriptionId == subscriptionId &&
                                                               y.SubscriptionDate.Type == newSubscriptionDateType))
                                       , Times.Once);
        }
        public async Task ShouldAddSubcriptionDate_WhenSubscripingFirstTime()
        {
            var today          = DateTime.Today;
            var subscriptionId = 1;
            SubscriptionDate subscriptionDate = null;

            SetupMocks(subscriptionId, subscriptionDate);
            var commandContext = new SuspendResumeSubscriptionContext(today);
            var command        = new SuspendResumeSubscriptionCommand(_queryBuilderMock.Object, _commandBuilderMock.Object);

            await command.ExecuteAsync(commandContext);

            _commandBuilderMock.Verify(x => x.ExecuteAsync(It.Is <AddSubcriptionDateRepositoryContext>
                                                               (y => y.SubscriptionDate.SubscriptionId == subscriptionId &&
                                                               y.SubscriptionDate.Type == SubscriptionDateType.Start))
                                       , Times.Once);
        }
        public async Task ShouldRemoveLastSubcriptionDate_WhenSubscriptionHasBeenAlreadyStartedOrSuspendedToday()
        {
            var today              = DateTime.Today;
            var subscriptionId     = 1;
            var subscriptionDateId = 1;
            SubscriptionDate lastSubscriptionDate = new SubscriptionDate
            {
                Id             = subscriptionDateId,
                SubscriptionId = subscriptionId,
                Date           = DateTime.UtcNow
            };

            SetupMocks(subscriptionId, lastSubscriptionDate);
            var commandContext = new SuspendResumeSubscriptionContext(today);
            var command        = new SuspendResumeSubscriptionCommand(_queryBuilderMock.Object, _commandBuilderMock.Object);

            await command.ExecuteAsync(commandContext);

            _commandBuilderMock.Verify(x => x.ExecuteAsync(It.Is <RemoveSubcriptionDateRepositoryContext>
                                                               (y => y.SubscriptionDate.SubscriptionId == subscriptionId &&
                                                               y.SubscriptionDate.Id == subscriptionDateId))
                                       , Times.Once);
        }