public void UpdateTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            MajorRepository repo = new MajorRepository();
            Assert.AreEqual(true, repo.Update(3, "Game", "Nitontan"));
        }
        public void DestroyTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            MajorRepository repo = new MajorRepository();
            Assert.AreEqual(true, repo.Destroy(3));
        }
        public void GetAllTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            MajorRepository repo = new MajorRepository();
            Assert.AreEqual(2, repo.GetAll());
        }
        public void CreateTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

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