public void GetByErroneousIdHaspKey() { using (var db = new EntitesContext()) { haspKeyL = Get(db); Assert.ThrowsException <ArgumentException>(() => haspKeyL.GetById(erroneousId)); } }
public void GetByIdNoDBHaspKey() { using (var db = new EntitesContext()) { ClearTable.HaspKeys(db); haspKeyL = Get(db); Assert.IsNull(haspKeyL.GetById(1)); } }
public void GetByIdHaspKey() { HaspKey getById; HaspKey keyExpected = CreateNew(1); using (var db = new EntitesContext()) { ClearTable.HaspKeys(db); haspKeyL = Get(db); haspKeyL.Save(CreateNew()); getById = haspKeyL.GetById(1); } Assert.AreEqual(getById, keyExpected); }
public ModelViewHaspKey GetById(int id) => new ModelViewHaspKey(keyLogic.GetById(id));