public void CantDeleteNotExistingDevice() { using (EF_ZMT_DbContext.EF_ZMT_DbContext context = new EF_ZMT_DbContext.EF_ZMT_DbContext()) { context.Context.ExecuteStoreCommand("DELETE FROM Device"); context.Context.ExecuteStoreCommand("DELETE FROM PeripheralDevice"); context.Context.ExecuteStoreCommand("DELETE FROM FixedAsset"); Assert.AreEqual(context.Context.Devices.Count(), 0); Assert.AreEqual(context.Context.PeripheralDevices.Count(), 0); Assert.AreEqual(context.Context.FixedAssets.Count(), 0); FixedAssetService transaction = new FixedAssetService(); FixedAsset asset = new FixedAsset() { inventory_number = "222222", cassation = false, date_of_activation = DateTime.Now }; PeripheralDevice pd = new PeripheralDevice() { name = "Kamera" }; Device device = new Device() { model = "x400", producer = "Sony", PeripheralDevice = pd, FixedAsset = asset }; transaction.DeleteDevice(device); } }