public void ShouldBeValid() { Locate locate = new Locate(); Assert.True(locate.NoErrors, "locate has errors"); }
public void ShouldAddRecordToLocate() { int numberOfObjectsWritten = 0; IUnitOfWork uow = facade.GetUnitOfWork(); Locate loc = new Locate { part = "503-831", descript = "whizzer", location = "bin4" }; try { if (loc.NoErrors) { uow.LocateRepo.Insert(loc); uow.Commit(); } else { throw new Exception("Location entity instance contained errors"); } } catch (Exception e) { Assert.Fail(e.Message.ToString()); } finally { numberOfObjectsWritten = uow.NumberOfObjectsWritten; facade.ReturnUnitOfWork(); Assert.AreEqual(1, numberOfObjectsWritten); } }