Exemplo n.º 1
0
        public void GivenCommonMapper_WhenMapApiPaginationRequestToPaginationRequest_ShouldMapSuccessfully()
        {
            // assign
            var apiPaginationRequest = CommonRequestBuilder.CreateApiPaginationRequest(3, 30);

            // act
            var paginationRequest = _mapper.Map <PaginationRequest>(apiPaginationRequest);

            //assert
            paginationRequest.ShouldSatisfyAllConditions(
                () => paginationRequest.ShouldNotBeNull(),
                () => paginationRequest.PageNumber.ShouldBe(apiPaginationRequest.PageNumber),
                () => paginationRequest.PageSize.ShouldBe(apiPaginationRequest.PageSize));
        }
Exemplo n.º 2
0
        public void GivenAccountMapper_WhenMapListMemberRequestToListMemberQuery_ShouldMapSuccessful()
        {
            // assign
            var pagination = CommonRequestBuilder.CreateApiPaginationRequest(10, 3);

            var listMemberRequest = MemberRequestBuilder.CreateListMembersRequest("jack", pagination);

            // act
            var listMemberQuery = _mapper.Map <ListMembersQuery>(listMemberRequest);

            // assert
            listMemberQuery.ShouldSatisfyAllConditions(
                () => listMemberQuery.ShouldNotBeNull(),
                () => listMemberQuery.MemberName.ShouldBe(listMemberRequest.MemberName),
                () => listMemberQuery.Pagination.ShouldNotBeNull(),
                () => listMemberQuery.Pagination.PageSize.ShouldBe(listMemberRequest.Pagination.PageSize),
                () => listMemberQuery.Pagination.PageNumber.ShouldBe(listMemberRequest.Pagination.PageNumber));
        }
Exemplo n.º 3
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));
        }