Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 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]);
     }
 }
Ejemplo n.º 4
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);
     }
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
 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);
     }
 }