Exemple #1
0
        public void IncomeCreateTest()
        {
            Income incomeTest = new Income();

            incomeTest.Name        = "Name test";
            incomeTest.Description = "Description test";
            Assert.IsTrue(incomeTest.Update() >= 0);
            incomeTest.Delete();
        }
Exemple #2
0
        public void IncomeDeleteTest()
        {
            Income incomeTest = new Income();

            incomeTest.Name        = "Name test";
            incomeTest.Description = "Description test";
            long id = incomeTest.Update();

            Assert.IsFalse(incomeTest.IsNull());
            incomeTest.Delete();
            Assert.IsTrue(incomeTest.IsNull());
        }
Exemple #3
0
        public void IncomeLoadTest()
        {
            Income incomeTest = new Income();

            incomeTest.Name        = "Name test";
            incomeTest.Description = "Description test";
            long   id          = incomeTest.Update();
            Income incomeTest2 = new Income(id);

            Assert.AreEqual(incomeTest.Id, incomeTest2.Id);
            incomeTest.Delete();
            incomeTest2.Delete();
        }
Exemple #4
0
        public void IncomeUpdateTest()
        {
            Random r          = new Random();
            string expected   = r.Next(0, 10000).ToString();
            Income incomeTest = new Income();

            incomeTest.Name        = "Name test";
            incomeTest.Description = "Description test";
            long id = incomeTest.Update();

            incomeTest.Description = expected;
            incomeTest.Update();
            Income incomeTest2 = new Income(id);

            Assert.AreEqual(expected, incomeTest2.Description);
            incomeTest.Delete();
            incomeTest2.Delete();
        }