public void GetByErroneousIdClient() { using (var db = new EntitesContext()) { clientL = Get(db); Assert.ThrowsException <ArgumentException>(() => clientL.GetById(erroneousId)); } }
public void GetByIdNoDBClient() { Client getById; using (var db = new EntitesContext()) { ClearTable.Clients(db); clientL = Get(db); getById = clientL.GetById(1); } Assert.IsNull(getById); }
public void GetByIdClient() { Client getById; Client clientExpected = CreateNew(1); using (var db = new EntitesContext()) { ClearTable.Clients(db); clientL = Get(db); clientL.Save(CreateNew()); getById = clientL.GetById(1); } Assert.AreEqual(getById, clientExpected); }
public ActionResult Update(int id) { return(View(_clientlogic.GetById(id))); }
public ModelViewClient GetById(int id) => new ModelViewClient(clientLogic.GetById(id));