public void ExpenditureUpdateTest() { Random r = new Random(); string expected = r.Next(0, 10000).ToString(); Expenditure ExpenditureTest = new Expenditure(); ExpenditureTest.Name = "Name test"; ExpenditureTest.Description = "Description test"; long id = ExpenditureTest.Update(); ExpenditureTest.Description = expected; ExpenditureTest.Update(); Expenditure ExpenditureTest2 = new Expenditure(id); Assert.AreEqual(expected, ExpenditureTest2.Description); ExpenditureTest.Delete(); ExpenditureTest2.Delete(); }
public void ExpenditureCreateTest() { Expenditure ExpenditureTest = new Expenditure(); ExpenditureTest.Name = "Name test"; ExpenditureTest.Description = "Description test"; Assert.IsTrue(ExpenditureTest.Update() >= 0); ExpenditureTest.Delete(); }
public void ExpenditureDeleteTest() { Expenditure ExpenditureTest = new Expenditure(); ExpenditureTest.Name = "Name test"; ExpenditureTest.Description = "Description test"; long id = ExpenditureTest.Update(); Assert.IsFalse(ExpenditureTest.IsNull()); ExpenditureTest.Delete(); Assert.IsTrue(ExpenditureTest.IsNull()); }
public void ExpenditureLoadTest() { Expenditure ExpenditureTest = new Expenditure(); ExpenditureTest.Name = "Name test"; ExpenditureTest.Description = "Description test"; long id = ExpenditureTest.Update(); Expenditure ExpenditureTest2 = new Expenditure(id); Assert.AreEqual(ExpenditureTest.Id, ExpenditureTest2.Id); ExpenditureTest.Delete(); ExpenditureTest2.Delete(); }