public void StoresByPersonalLocationLargeRadius() { using (StoresController controller = new StoresController(new MockGeoServiceAgent(), this.UnitOfWork)) { Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(Constants.UserName), new string[] { }); var stores = controller.FindStoresByPersonalLocation(Constants.PersonalLocationId, 10); Assert.AreEqual(1, stores.Count); } }
public void StoresByLatLongSmallRadius() { using (StoresController controller = new StoresController(new MockGeoServiceAgent(), this.UnitOfWork)) { Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(Constants.UserName), new string[] { }); var stores = controller.FindStoresByLatitudeAndLongitude((decimal)Constants.HomeLatitude, (decimal)Constants.HomeLongitude, 1); Assert.AreEqual(0, stores.Count); } }
public void AllCitiesTest() { using (StoresController controller = new StoresController(new MockGeoServiceAgent(), this.UnitOfWork)) { var cities = controller.AllCities(); Assert.AreEqual(4, cities.Count); Assert.AreEqual(Constants.Springfield, cities[0]); } }
public void AddAndDeleteStore() { using (StoresController controller = new StoresController(new MockGeoServiceAgent(), this.UnitOfWork)) { Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(Constants.UserName), new string[] { }); var stores = controller.GetStoresForCurrentUser(); Assert.AreEqual(3, stores.Count); controller.AddStoreForCurrentUser(998); stores = controller.GetStoresForCurrentUser(); Assert.AreEqual(4, stores.Count); controller.DeleteStoreForCurrentUser(998); stores = controller.GetStoresForCurrentUser(); Assert.AreEqual(3, stores.Count); } }
public void StoresNotUsedByUser() { using (StoresController controller = new StoresController(new MockGeoServiceAgent(), this.UnitOfWork)) { Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(Constants.UserName), new string[] { }); var stores = controller.FindStoresNotUsedByCurrentUser(); Assert.AreEqual(2, stores.Count); } }
public void StoresByPostalCodeSmallRadius() { using (StoresController controller = new StoresController(new MockGeoServiceAgent(), this.UnitOfWork)) { Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(Constants.UserName), new string[] { }); var stores = controller.FindStoresByPostalCode("L6H 6J1", 1); Assert.AreEqual(0, stores.Count); } }