Beispiel #1
0
        public void GetTourById_ValueReturned()
        {
            mock.Setup(m => m.Tours.GetAll()).Returns(tours);
            mock.Setup(m => m.Tours.Get(1)).Returns(tours.ElementAt(0));
            var         mapper  = new MapperConfiguration(cfg => cfg.CreateMap <Tour, TourDTO>()).CreateMapper();
            TourService service = new TourService(mock.Object);
            //ISerialize<TourDTO> serialize = new TourSerialize();

            //string example = serialize.serializeVary(mapper.Map<Tour, TourDTO>(tours.ElementAt(0)));

            TourDTO data = service.GetTour(1);

            Assert.IsNotNull(data);
        }