Exemplo n.º 1
0
        public TripCandidate GetTripCandidateTest([PexAssumeUnderTest] TripCreationService target, int index)
        {
            TripCandidate result = target.GetTripCandidate(index);

            return(result);
            // TODO: add assertions to method TripCreationServiceTest.GetTripCandidateTest(TripCreationService, Int32)
        }
Exemplo n.º 2
0
        public void TripSmartBuilder_BuildTripCandidates_WriteFile()
        {
            using (
                var streamWriter =
                    new StreamWriter(File.Open(@"c:\TripLine\BuildTripCandidates.txt", FileMode.Create, FileAccess.Write)))
            {
                var sessions = _photoStore.CreateNewPhotoSessions();

                _tripSmartBuilder.Build(sessions);

                Assert.IsTrue(_tripSmartBuilder.BuildedTrips.Any());

                TripCandidate lastTrip = null;

                streamWriter.WriteLine($"Got {_tripSmartBuilder.BuildedTrips.Count} new trips");

                foreach (var trip in _tripSmartBuilder.BuildedTrips)
                {
                    //if(lastTrip != null)
                    //   Assert.IsTrue(trip.FromDate > lastTrip.ToDate );

                    ValidateTrip(trip);

                    streamWriter.WriteLine($"   {trip.Describe}");

                    lastTrip = trip;
                }
            }
        }
Exemplo n.º 3
0
 private void ValidateTrip(TripCandidate trip)
 {
     Assert.IsTrue(trip.PhotoSessions.Any());
 }
Exemplo n.º 4
0
        public static TripCandidateModel CreateTripCandidateModel(TripCandidate trip)
        {
            TripCandidateModel model = AutoMapper.Mapper.Map <TripCandidateModel>(trip);

            return(model);
        }