public void SingleProductNotInUsersList()
 {
     InventoryRequest request = new InventoryRequest();
     request.ProductId = 998; // A product that exists but is not in the user's list
     User user = this.DomainContext.Users.Single(u => u.Username == "jmclachl");
     var products = request.GetProductIdsToFind(user);
     Assert.AreEqual(1, products.Count());
     Assert.IsTrue(products.Contains(request.ProductId));
 }
 public void AllUsersStores()
 {
     InventoryRequest request = new InventoryRequest();
     request.StoreNumber = 998; // A store that exists but is not in the user's store list
     request.StoreNumberType = StoreNumberType.AllUsersStores;
     User user = this.DomainContext.Users.Single(u => u.Username == "jmclachl");
     var stores = request.GetStoreNumbersToFind(this.DomainContext, user);
     Assert.AreEqual(3, stores.Count());
     Assert.IsFalse(stores.Contains(request.StoreNumber));
 }
 public void AllUsersProducts()
 {
     InventoryRequest request = new InventoryRequest();
     request.ProductId = 998; // A product that exists but is not in the user's list
     request.ProductIdType = ProductIdType.AllUsersProducts;
     User user = this.DomainContext.Users.Single(u => u.Username == "jmclachl");
     var products = request.GetProductIdsToFind(user);
     Assert.AreEqual(3, products.Count());
     Assert.IsFalse(products.Contains(request.ProductId));
 }
 public void AllStoresWithStoreThatDoesntExist()
 {
     InventoryRequest request = new InventoryRequest();
     request.StoreNumber = 999; // A store that doesn't exist
     request.StoreNumberType = StoreNumberType.AllStores;
     User user = this.DomainContext.Users.Single(u => u.Username == "jmclachl");
     var stores = request.GetStoreNumbersToFind(this.DomainContext, user);
     Assert.AreEqual(5, stores.Count());
     Assert.IsFalse(stores.Contains(request.StoreNumber));
 }
 public void SingleStore()
 {
     InventoryRequest request = new InventoryRequest();
     request.StoreNumber = 45; // A store that in the user's list
     User user = this.DomainContext.Users.Single(u => u.Username == "jmclachl");
     var stores = request.GetStoreNumbersToFind(this.DomainContext, user);
     Assert.AreEqual(1, stores.Count());
     Assert.IsTrue(stores.Contains(request.StoreNumber));
 }
 public void SingleProductThatDoesntExist()
 {
     InventoryRequest request = new InventoryRequest();
     request.ProductId = 999; // A product that doesn't exist
     User user = this.DomainContext.Users.Single(u => u.Username == "jmclachl");
     var products = request.GetProductIdsToFind(user);
     Assert.AreEqual(1, products.Count());
     Assert.IsTrue(products.Contains(request.ProductId));
 }
 public void TestRequest()
 {
     InventoryRequest request = new InventoryRequest();
     request.ProductId = 99;
     request.ProductIdType = ProductIdType.AllUsersProducts;
     request.StoreNumber = 45;
     request.StoreNumberType = StoreNumberType.AllUsersStores;
     User user = this.DomainContext.Users.Single(u => u.Username == "jmclachl");
     var products = request.GetProductIdsToFind(user);
     Assert.AreEqual(3, products.Count());
     var stores = request.GetStoreNumbersToFind(this.DomainContext, user);
     Assert.AreEqual(3, stores.Count());
 }