示例#1
0
        ////[ExpectedException(typeof(ArgumentException))]
        public void UpdateGraduateCourseAppErrorTest()
        {
            //// Arrange
            var errors                   = new List <string>();
            var mockRepository           = new Mock <IGraduateCourseAppRepository>();
            var graduatecourseappService = new GraduateCourseAppService(mockRepository.Object);

            //// Act
            graduatecourseappService.UpdateGraduateCourseApp(null, ref errors);

            //// Assert
            Assert.AreEqual(1, errors.Count);
        }
示例#2
0
        public string UpdateGraduateCourseApp(GraduateCourseApp graduateCourseApp)
        {
            var errors     = new List <string>();
            var repository = new GraduateCourseAppRepository();
            var service    = new GraduateCourseAppService(repository);

            service.UpdateGraduateCourseApp(graduateCourseApp, ref errors);

            if (errors.Count == 0)
            {
                return("ok");
            }

            return("error");
        }
示例#3
0
        ////[ExpectedException(typeof(ArgumentException))]
        public void UpdateGraduateCourseAppErrorTestSuccess()
        {
            //// Arrange
            var errors                   = new List <string>();
            var mockRepository           = new Mock <IGraduateCourseAppRepository>();
            var graduatecourseappService = new GraduateCourseAppService(mockRepository.Object);
            var x = new GraduateCourseApp {
                StudentId = "A15614654564"
            };

            //// Act
            graduatecourseappService.UpdateGraduateCourseApp(x, ref errors);

            //// Assert
            Assert.AreEqual(0, errors.Count);
        }