public void CanDeleteFixedAsset() { using (EF_ZMT_DbContext.EF_ZMT_DbContext context = new EF_ZMT_DbContext.EF_ZMT_DbContext()) { context.Context.ExecuteStoreCommand("DELETE FROM FixedAsset"); FixedAssetService transaction = new FixedAssetService(); FixedAsset asset = new FixedAsset() { inventory_number = "222222", cassation = false, date_of_activation = DateTime.Now, MPK = "AAAAAA" }; transaction.AddFixedAsset(asset); asset = context.Context.FixedAssets.FirstOrDefault(x => x.inventory_number == "222222"); Assert.IsNotNull(asset); Assert.AreEqual(context.Context.FixedAssets.Count(), 1); transaction.DeleteFixedAsset(asset); asset = context.Context.FixedAssets.FirstOrDefault(x => x.inventory_number == "222222"); Assert.IsNull(asset); Assert.AreEqual(context.Context.FixedAssets.Count(), 0); } }