public void InsertFinalScheduleErrorTest()
        {
            //// Arrange
            var errors               = new List <string>();
            var mockRepository       = new Mock <IFinalScheduleRepository>();
            var finalScheduleService = new FinalScheduleService(mockRepository.Object);

            //// Act
            finalScheduleService.InsertFinalSchedule(null, ref errors);

            //// Assert
            Assert.AreEqual(1, errors.Count);
        }
Beispiel #2
0
        public string InsertFinalSchedule(FinalSchedule finalSchedule)
        {
            var errors     = new List <string>();
            var repository = new FinalScheduleRepository();
            var service    = new FinalScheduleService(repository);

            service.InsertFinalSchedule(finalSchedule, ref errors);
            if (errors.Count == 0)
            {
                return("ok");
            }

            return("error");
        }
        public void InsertFinalScheduleTest2()
        {
            //// Arrange
            var errors               = new List <string>();
            var mockRepository       = new Mock <IFinalScheduleRepository>();
            var finalScheduleService = new FinalScheduleService(mockRepository.Object);
            var finalSchedule        = new FinalSchedule
            {
                Schedule_id   = -1,
                FinalLocation = string.Empty,
                FinalTime     = string.Empty,
                Title         = string.Empty
            };

            //// Act
            finalScheduleService.InsertFinalSchedule(finalSchedule, ref errors);

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