Пример #1
0
        public void RemoveTest()
        {
            Course c = new Course();
            c.CourseID = 5000;
            c.Title = "berna";
            c.Credits = 4;
            c.DepartmentID = 7;
            int id = CourseManager.Add(c);

            bool elimina = CourseManager.Remove(id);
            Assert.AreEqual(elimina, true);
        }
Пример #2
0
        protected void btnADDCurso_Click(object sender, EventArgs e)
        {
            Course curso = new Course();

            curso.CourseID = Convert.ToInt32(this.txtID.Text);
            curso.Credits = Convert.ToInt32(this.txtCreditos.Text);
            curso.Title = this.txtNombre.Text;
            curso.DepartmentID = Convert.ToInt32(this.txtDepartamento.Text);

            CourseManager.Add(curso);
            Response.Redirect("cursos.aspx");
        }
Пример #3
0
        public void getAllTest()
        {
            List<Course> lista = CourseManager.getAll();
            int numero = lista.Count;

            Course c = new Course();
            c.CourseID = 5000;
            c.Title = "berna";
            c.Credits = 4;
            c.DepartmentID = 7;
            int id = CourseManager.Add(c);

            lista = CourseManager.getAll();
            int numero2 = lista.Count;
            Assert.AreEqual(numero + 1, numero2);

            bool elimina = CourseManager.Remove(id);
            lista = CourseManager.getAll();
            int numero3 = lista.Count;
            Assert.AreEqual(numero, numero3);
        }