コード例 #1
0
        public async void Piping_Submitted_Loan_Requests_Will_Queue_Them()
        {
            ILoanRequestRepository            repo = new InMemoryLoanRequestRepository();
            IReadOnlyCollection <LoanRequest> submittedLoanRequests =
                await repo.AllSubmittedLoanRequests();

            IPipe <IReadOnlyCollection <LoanRequest> > pipe = new InMemoryQueueBackedPipe();
            await pipe.Write(submittedLoanRequests);
        }
コード例 #2
0
        public async void Retrieving_Submitted_Loan_Requests_Will_Retrieve_Them()
        {
            ILoanRequestRepository            repo = new InMemoryLoanRequestRepository();
            IReadOnlyCollection <LoanRequest> submittedLoanRequests =
                await repo.AllSubmittedLoanRequests();

            Assert.True(submittedLoanRequests != null);
            Assert.True(submittedLoanRequests.Any());
            Assert.True(
                submittedLoanRequests
                .Count(x => x.RequestedLoanAmount > 0.0m) == submittedLoanRequests.Count);
            Assert.True(
                submittedLoanRequests
                .Count(x => !string.IsNullOrWhiteSpace(x.CitizenServiceNumber)) == submittedLoanRequests.Count);
        }