コード例 #1
0
        public void ShowServiceByLowCostAndNameTest()
        {
            string nombre = "Electricista";

            mockRepository.Setup(x => x.ShowServiceByLowCostAndName(nombre))
            .Returns(listaServiceDetailsDTO.Where(y => y.ServiceName == nombre).OrderByDescending(y => y.Cost));

            var handler = new ShowServiceByLowCostAndNameHandler(mockRepository.Object);

            // Act
            ShowServiceByLowCostAndName ssbln = new ShowServiceByLowCostAndName(nombre);

            var res = handler.Handle(ssbln, ct);

            Assert.IsNotNull(res.Result);
        }
 public Task <IEnumerable <ServiceDetailsDTO> > Handle(ShowServiceByLowCostAndName request, CancellationToken cancellationToken)
 {
     return(Task.Run(() => {
         return serviceDetailsRepository.ShowServiceByLowCostAndName(request.Name);
     }));
 }