예제 #1
0
        public void GivenAccountMapper_WhenMapListAccountRequestToListAccountQuery_ShouldMapSuccessful()
        {
            // assign
            var pagination         = CommonRequestBuilder.CreateApiPaginationRequest(10, 3);
            var listAccountRequest = AccountRequestBuilder.CreateListAccountsRequest("active", "ZIP10000001", pagination);

            // act
            var listAccountQuery = _mapper.Map <ListAccountsQuery>(listAccountRequest);

            // assert
            listAccountQuery.ShouldSatisfyAllConditions(
                () => listAccountQuery.ShouldNotBeNull(),
                () => listAccountQuery.AccountNumber.ShouldBe(listAccountRequest.AccountNumber),
                () => listAccountQuery.AccountStatusId.ToString().ToLower().ShouldBe(listAccountRequest.AccountStatus.ToLower()),
                () => listAccountQuery.Pagination.ShouldNotBeNull(),
                () => listAccountQuery.Pagination.PageSize.ShouldBe(listAccountRequest.Pagination.PageSize),
                () => listAccountQuery.Pagination.PageNumber.ShouldBe(listAccountRequest.Pagination.PageNumber));
        }