Exemplo n.º 1
0
        public async Task TestPartyDelete()
        {
            try
            {
                UOW.BeginTransaction();
                Party result = await PartyService.GetByID(Context, 1);

                Assert.IsNotNull(result, "Expect to find Democratic Party");
                Assert.AreEqual(result.Description, "Democratic Party", "Expect to find Party Description = Democratic Party");
                Party deleted = await PartyService.Delete(UOW, result.Id);

                UOW.CloseTransaction();
                Assert.IsTrue(deleted.Active == false, "Expect new Party active flag to be false.");
            }
            catch (Exception ex)
            {
                Assert.IsNull(ex, "Exception Thrown: " + ex.Message);
            }
        }
 public ActionResult Delete(int ID)
 {
     type.Delete(ID);
     return(View());
 }