示例#1
0
        public void TestAddProject()
        {
            SqlClass.DestroyDB();
            SqlClass.InitializeDB();
            DateTime now = DateTime.Now;
            DateTime dt  = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0); // important to use 0 for seconds since dbmanager doesn't store seconds

            System.Drawing.Color testColor = System.Drawing.Color.Red;
            DateTime             dt2       = new DateTime(2019, 12, 25, 0, 0, 0);
            Project        p            = new Project("test proj", dt, dt2, testColor, "test description");
            List <Project> projs_before = SqlClass.GetProjects(dt);

            Console.WriteLine(projs_before.Count);
            SqlClass.AddProject(p);
            List <Project> projs_after = SqlClass.GetProjects(dt);

            Assert.AreEqual(projs_before.Count + 1, projs_after.Count);
        }