示例#1
0
        public void ExpenditureCreateTest()
        {
            Expenditure ExpenditureTest = new Expenditure();

            ExpenditureTest.Name        = "Name test";
            ExpenditureTest.Description = "Description test";
            Assert.IsTrue(ExpenditureTest.Update() >= 0);
            ExpenditureTest.Delete();
        }
示例#2
0
        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());
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }