public Task <IEnumerable <ServiceDTO> > Handle(ShowServicesByCategory request, CancellationToken cancellationToken)
 {
     return(Task.Run(() =>
     {
         return serviceRepository.ShowServicesByCategory(request.Name);
     }));
 }
Beispiel #2
0
        public void ShowServicesByCategoryTest()
        {
            string nombre = "Electricista";

            mockRepository.Setup(x => x.ShowServicesByCategory(nombre))
            .Returns(listaServiceDTO.Where(y => y.CategoryName == nombre));

            var handler = new ShowServicesByCategoryHandler(mockRepository.Object);
            ShowServicesByCategory ssbc = new ShowServicesByCategory(nombre);
            var res = handler.Handle(ssbc, ct);

            Assert.IsNotNull(res.Result);
        }