Пример #1
0
        public void UpdateTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            MajorRepository repo = new MajorRepository();
            Assert.AreEqual(true, repo.Update(3, "Game", "Nitontan"));
        }
Пример #2
0
        public void DestroyTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            MajorRepository repo = new MajorRepository();
            Assert.AreEqual(true, repo.Destroy(3));
        }
Пример #3
0
        public void GetAllTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            MajorRepository repo = new MajorRepository();
            Assert.AreEqual(2, repo.GetAll());
        }
Пример #4
0
        public void CreateTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            MajorRepository repo = new MajorRepository();
            Assert.AreEqual(true, repo.Create("Game", "Playing game!"));
        }
Пример #5
0
 public MajorController()
 {
     view = new GenericView();
     majorRepo = new MajorRepository();
 }