Esempio n. 1
0
        public void AddMail_Exception()
        {
            LecturersService service = new LecturersService();

            LecturerModel expected = new LecturerModel()
            {
                Id            = 4,
                Le_Last_Name  = "ddad",
                Le_First_Name = "sasd",
                Phone         = "8 999 222-11-11",
                Email         = "23233.ru"
            };

            Assert.Throws <InvalidMailExeption>(() => service.AddLecturer(expected));
        }
Esempio n. 2
0
        public void AddPhone_Exception()
        {
            LecturersService service = new LecturersService();

            LecturerModel expected = new LecturerModel()
            {
                Id            = 4,
                Le_Last_Name  = "ddds",
                Le_First_Name = "ssad",
                Phone         = "42s4d323",
                Email         = "*****@*****.**",
            };

            Assert.Throws <InvalidPhoneException>(() => service.AddLecturer(expected));
        }
Esempio n. 3
0
        public void AddName_Exception()
        {
            LecturersService service = new LecturersService();

            LecturerModel expected = new LecturerModel()
            {
                Id            = 4,
                Le_Last_Name  = "242df34",
                Le_First_Name = "s41s",
                Phone         = "8 999 222-11-11",
                Email         = "*****@*****.**"
            };

            Assert.Throws <InvalidNameException>(() => service.AddLecturer(expected));
        }
Esempio n. 4
0
 public void Post([FromBody] LecturerModel value)
 {
     _lecturer.AddLecturer(value);
 }