public void SearchByDistanceTest() { NeighborhoodRepository repository = new NeighborhoodRepository(new PersistanceFramework(new COHHomeEntities())); //Ashcott Point point = new Point { Longitude = -95.574233, Latitude = 29.707864 }; var closeHoods = repository.FindNearPoint(point); Assert.AreEqual(1,closeHoods.Count(n=>n.Id == TestNeighborHoodId),"Aschott should be near Brays Village"); //Kim Son point = new Point { Longitude = -95.567014, Latitude = 29.704069 }; closeHoods = repository.FindNearPoint(point); Assert.AreEqual(1, closeHoods.Count(n => n.Id == TestNeighborHoodId), "Kim Son should be near Brays Village"); //6015 Skyline point = new Point { Longitude = -95.484719, Latitude = 29.728415 }; closeHoods = repository.FindNearPoint(point); Assert.AreEqual(0, closeHoods.Count(n => n.Id == TestNeighborHoodId), "Skyline should not be near Brays Village"); }
public TripControllerTests(ControllerFixture fixture) { Context = fixture.Context; TripRepository = fixture.TripRepository; CalendarRepository = fixture.CalendarRepository; CompanyRepository = fixture.CompanyRepository; NeighborhoodRepository = fixture.NeighborhoodRepository; PatternAreaRepository = fixture.PatternAreaRepository; PaymentTypeRepository = fixture.PaymentTypeRepository; VehicleRepository = fixture.VehicleRepository; VehicleTypeRepository = fixture.VehicleTypeRepository; }
public void SearchByNameTest() { var mockPersistance = new Moq.Mock<IPersistanceFramework>(); mockPersistance.Setup(m => m.CreateQueryContext<Neighborhood>()).Returns( GetTestNeighborhoods()); NeighborhoodRepository repository = new NeighborhoodRepository(mockPersistance.Object); var results = repository.FindBySimilarName("First"); Assert.AreEqual(1,results.Count(),"Wrong Number of results"); Assert.AreEqual("FirstOne", results[0].Name); }