Beispiel #1
0
        public async Task GetApplicationsAccountNames_Returns_GetApplicationsAccountNamesResponse()
        {
            var controllerResponse = await _controller.RejectApplications(_pledgeId);

            var okObjectResult = controllerResponse as OkObjectResult;
            var response       = okObjectResult.Value as GetRejectApplicationsResponse;

            Assert.IsNotNull(okObjectResult);
            Assert.IsNotNull(response);
            Assert.AreEqual(_queryResult.Applications.Count(), response.Applications.Count());
        }
        public async Task Reject_Applications_Performs_Bulk_Applications_Rejection_With_Status_Ok(
            int accountId,
            int pledgeId,
            RejectApplicationsRequest applicationRejectRequest,
            [Frozen] Mock <IMediator> mockMediator,
            [Greedy] PledgeController pledgeController)
        {
            mockMediator
            .Setup(x => x.Send(
                       It.Is <RejectApplicationsCommand>((x) => (x.PledgeId == pledgeId) && (x.AccountId == accountId)),
                       It.IsAny <CancellationToken>()))
            .ReturnsAsync(Unit.Value);

            applicationRejectRequest.ApplicationsToReject = new List <int> {
                5
            };

            var controllerResponse = await pledgeController.RejectApplications(accountId, pledgeId, applicationRejectRequest);

            var statusResult = controllerResponse as StatusCodeResult;

            Assert.IsNotNull(statusResult);
            Assert.AreEqual((int)HttpStatusCode.OK, statusResult.StatusCode);
        }