public void TestDelete() { Jurk jurk = new Jurk() { Artikelnummer = 9999999, JurkId = 1 }; Jurk jurk2 = new Jurk() { Artikelnummer = 11111111, JurkId = 2 }; HoneyMoonShopContext context = new HoneyMoonShopContext(); context.Add(jurk); context.Add(jurk2); var mock = new Mock <IHoneymoonshopRepository>(); mock.Setup(x => x.DeleteJurk(jurk.JurkId)); BeheerController beheer = new BeheerController(mock.Object); beheer.Delete(jurk.JurkId); mock.Verify(f => f.DeleteJurk(jurk.JurkId)); }