Beispiel #1
0
        public IEnumerable <string> GetKudosFilteringTypes()
        {
            var statuses = new List <string> {
                ConstBusinessLayer.KudosFilteringTypeAllFilter
            };
            var kudosTypeDto = _kudosService.GetKudosTypes(GetUserAndOrganization());

            return(statuses.Concat(kudosTypeDto.Select(s => s.Name)));
        }
Beispiel #2
0
        public void Should_Return_All_Kudos_Types()
        {
            var userAndOrg = new UserAndOrganizationDTO
            {
                UserId = "testUserId2"
            };

            var types = _kudosService.GetKudosTypes(userAndOrg);

            Assert.AreEqual(5, types.Count());
        }
Beispiel #3
0
        public IEnumerable <KudosTypeViewModel> GetKudosTypes()
        {
            var kudosTypeDto       = _kudosService.GetKudosTypes(GetUserAndOrganization());
            var kudosTypeViewModel = _mapper.Map <IEnumerable <KudosTypeDTO>, IEnumerable <KudosTypeViewModel> >(kudosTypeDto);

            return(kudosTypeViewModel);
        }
        public void GetKudosTypes_Should_Return_IEnumerable_Of_KudosType_ViewModel()
        {
            var userAndOrganization = new UserAndOrganizationDTO()
            {
                OrganizationId = 1,
                UserId         = "fd798623-166c-412d-a060-369d4c7b90eb"
            };

            _kudosService.GetKudosTypes(userAndOrganization)
            .Returns(new List <KudosTypeDTO>()
            {
                new KudosTypeDTO()
            });

            var response = _kudosController.GetKudosTypes();

            Assert.IsInstanceOf <IEnumerable <KudosTypeViewModel> >(response);
        }