Пример #1
0
        public async Task ShouldGetUserCommitteeBranchesModelSuccess(string agencyCode)
        {
            BranchCommitteeUserSearchCriteriaModel searchCriteria = new BranchCommitteeUserSearchCriteriaModel();

            _moqIDMQueries.Setup(i => i.FindCommitteeAssignedToUser(It.IsAny <string>(), It.IsAny <int>()))
            .Returns(() =>
            {
                return(Task.FromResult <List <CommitteeUserAssignModel> >(new CommitteeDefaults().GetAllCommitteeUserAssignModel()));
            });


            _moqIDMQueries.Setup(i => i.FindBranchesAssignedToUser(It.IsAny <string>(), It.IsAny <int>()))
            .Returns(() =>
            {
                return(Task.FromResult <List <BranchUserAssignModel> >(new BranchDefaults().GetAllBranchesUserAssignModel()));
            });

            var result = await _sut.GetUserCommitteeBranchesModel(agencyCode, searchCriteria);

            Assert.NotNull(result);
        }
Пример #2
0
        public async Task <QueryResult <UserCommitteeBranchesModel> > GetUserCommitteeBranchesModel(BranchCommitteeUserSearchCriteriaModel userSearchCriteriaModel)
        {
            if (userSearchCriteriaModel.PageNumber <= 0 && userSearchCriteriaModel.PageSize <= 0)
            {
                userSearchCriteriaModel.PageNumber = 1; userSearchCriteriaModel.PageSize = 10;
            }
            string agencyCode = User.UserAgency();

            if (User.UserRole() == RoleNames.CustomerService || User.UserRole() == RoleNames.MonafasatAccountManager)
            {
                agencyCode = null;
            }
            var userCommitteeBranchesList = await _iDMAppService.GetUserCommitteeBranchesModel(agencyCode, userSearchCriteriaModel);

            return(userCommitteeBranchesList);
        }