コード例 #1
0
        public void DeleteTest()
        {
            ProgDec progDec = new ProgDec();

            ProgDecList progDecs = new ProgDecList();

            progDecs.Load();

            progDec = progDecs.Where(p => p.StudentId == -99).FirstOrDefault();

            int result = progDec.Delete();

            Assert.IsTrue(result > 0);
        }
コード例 #2
0
        public void UpdateTest()
        {
            ProgDec progDec = new ProgDec();

            ProgDecList progDecs = new ProgDecList();

            progDecs.Load();

            progDec = progDecs.Where(p => p.StudentId == -99).FirstOrDefault();

            progDec.ProgramId = 5;
            progDec.Update();

            ProgDec updatedProgDec = new ProgDec();

            updatedProgDec.Id = progDec.Id;
            updatedProgDec.LoadById();

            Assert.AreEqual(progDec.ProgramId, updatedProgDec.ProgramId);
        }