Пример #1
0
        public AddNewCourse()
        {
            InitializeComponent();
            List <string> teachers = teacher.getTeacherName();

            //int id = teacher.getTeacherId("ALLA");

            TeacherList.DataSource = teachers;
        }
Пример #2
0
        public void GetteacherIdTest()
        {
            string connStr = @"Data Source=DESKTOP-SDGK59R\SQLEXPRESS;
                            Initial Catalog=dance_school;
                            
                            Integrated Security=True";

            using (TransactionScope ts = new TransactionScope())
            {
                using (SqlConnection connection =
                           new SqlConnection(connStr))
                {
                    connection.Open();
                    TeacherAccount teacher = new TeacherAccount();

                    List <string> list = teacher.getTeacherName();


                    Assert.AreEqual(2, list.Count);
                }
            }
        }