public async Task ShouldAssignCandidateToAllTestsWhenConditionsAreMet()
        {
            BackdoorLogger logger = new BackdoorLogger();
            var            cmd    = new AssignCandidateToExamsCommand(logger, DbContext.Object);
            var            result = await cmd.Execute(1);

            Assert.IsTrue(result.Success);
            Assert.AreEqual("Kandydat o Id:1 został zapisany na 2 egzaminów (2,4)", logger.Logs.ToString());
        }
Example #2
0
        protected async override Task <OperationResult> DoExecute(PaymentResponseDto response)
        {
            int userId = GetUserIdFromControlLink(response);

            //insert successful payment
            await _updateSuccessfulPaymentCommand.Execute(response);

            //delete previously used link
            Data.Entities.PaymentLink link = await _removeExistingPaymentLink.Execute(userId);

            //delete link from Dotpay
            await _removePaymentLinkInDotpayCommand.Execute(link);

            //auto-assign candidate to all exams
            await _assignCandidateToExamsCommand.Execute(userId);

            return(new OperationSucceded());
        }