Exemplo n.º 1
0
        public void Should_delete_entity()
        {
            Expect.Call(() => _instancePlugin.Delete(_dog));
            _mockery.ReplayAll();

            new Repository <Dog>().Delete(_dog);

            _mockery.VerifyAll();
        }
        public void Should_delete_entity()
        {
            var uniqueDogName = Guid.NewGuid().ToString();

            var dog = new Dog {
                Age = 15, Name = uniqueDogName
            };

            PluginInstance.Save(dog);
            PluginInstance.Delete(dog);

            var dogs = PluginInstance.Get <Dog>(new Dog {
                Age = 15, Name = uniqueDogName
            });

            Assert.That(dogs.Count, Is.EqualTo(0));
        }
Exemplo n.º 3
0
 public ActionResult Delete(int id, IFormCollection collection)
 {
     try
     {
         var temp = computerPersistenceService.Load().First(item => item.Id == id);
         if (temp != null)
         {
             computerPersistenceService.Delete(temp);
         }
         else
         {
             var temp1 = laptopPersistenceService.Load().First(item => item.Id == id);
             laptopPersistenceService.Delete(temp1);
         }
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 4
0
        internal void Delete(object entity)
        {
            _plugin.Delete(entity);

            InstanceLogger.Log(this, "Delete", entity);
        }