Esempio n. 1
0
        public async Task FindById()
        {
            var discipline     = (await DisciplineDao.FindAllAsync()).First();
            var disciplineById = await DisciplineDao.FindByIdAsync(discipline.Id);

            Assert.AreEqual(discipline.DisciplineName, disciplineById?.DisciplineName);
        }
Esempio n. 2
0
        public async Task DeleteTest()
        {
            var disciplineId = await DisciplineDao.InsertGetIdAsync(new Discipline { DisciplineName = "E" });

            await DisciplineDao.DeleteAsync(disciplineId.Value);

            Assert.IsNull(await DisciplineDao.FindByIdAsync(disciplineId.Value));
        }
Esempio n. 3
0
        public async Task UpdateTest()
        {
            var discipline = (await DisciplineDao.FindAllAsync()).First();

            discipline.DisciplineName = "ABC";
            await DisciplineDao.UpdateAsync(discipline);

            var disciplineById = await DisciplineDao.FindByIdAsync(discipline.Id);

            Assert.AreEqual("ABC", disciplineById?.DisciplineName);
        }
Esempio n. 4
0
        public async Task InsertTest()
        {
            var disciplineId = await DisciplineDao.InsertGetIdAsync(new Discipline
            {
                DisciplineName = "XXX"
            });

            var disciplineById = await DisciplineDao.FindByIdAsync(disciplineId.Value);

            Assert.AreEqual("XXX", disciplineById?.DisciplineName);
        }