public void ChangedStoreNotDetected()
        {
            // Change an existing store then check that it was changed back to normal
            var store998 = this.DomainContext.Stores.Single(s => s.Id == 998);
            store998.Address = "Not 1 Mockafella Plaza";
            this.DomainContext.SaveChanges();

            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(UserName), new string[] { });
            LcboInventoryServiceAgentStub lcboServiceAgentStub = new LcboInventoryServiceAgentStub();
            lcboServiceAgentStub.RetireveMatches3Response.Add(new LcboInventoryData2() { StoreNumber = 998, City = "Capitol City", NumberInStock = 60, ProductId = 18, StreetAddress = "1 Mockafella Plaza" });
            LcboStoresServiceAgentStub lcboStoresServiceAgentStub = new LcboStoresServiceAgentStub();
            lcboStoresServiceAgentStub.GetLocationDetailsResponse = new LcboStoreInformation() { AddressLine = "1 Mockafella Plaza", City = "Capitol City", StoreNumber = 998 };
            using (InventoryController controller = new InventoryController(lcboServiceAgentStub, lcboStoresServiceAgentStub, this.DomainContext))
            {
                var storesWithInventory = controller.GetInventoriesWithRequest(new BusinessEntities.InventoryRequest() { ProductId = 18, StoreNumber = 998 });
                store998 = this.DomainContext.Stores.Single(s => s.Id == 998);
            }

            Assert.AreEqual("Not 1 Mockafella Plaza", store998.Address);
        }
        public void NewStoreDetected()
        {
            var store998 = this.DomainContext.Stores.Single(s => s.Id == 998);
            this.DomainContext.Delete<Store>(998);
            this.DomainContext.SaveChanges();

            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(UserName), new string[] { });
            LcboInventoryServiceAgentStub lcboServiceAgentStub = new LcboInventoryServiceAgentStub();
            lcboServiceAgentStub.RetireveMatches3Response.Add(new LcboInventoryData2() { StoreNumber = 998, City = "Capitol City", NumberInStock = 60, ProductId = 18, StreetAddress = "1 Mockafella Plaza" });
            LcboStoresServiceAgentStub lcboStoresServiceAgentStub = new LcboStoresServiceAgentStub();
            lcboStoresServiceAgentStub.GetLocationDetailsResponse = new LcboStoreInformation() { AddressLine = store998.Address, City = store998.City, StoreNumber = store998.Id, Latitude = store998.Latitude, Longitude = store998.Longitude };
            using (InventoryController controller = new InventoryController(lcboServiceAgentStub, lcboStoresServiceAgentStub, this.DomainContext))
            {
                var storesWithInventory = controller.GetInventoriesWithRequest(new BusinessEntities.InventoryRequest() { ProductId = 18, StoreNumber = 998 });
                store998 = this.DomainContext.Stores.Single(s => s.Id == 998);
            }

            Assert.AreEqual("1 Mockafella Plaza", store998.Address);
        }