public void Write_FileDoesNotExist_ShouldCreateFile()
        {
            File.Delete(_LOGFILEPATH);
            _serviceLogger = new ServiceLogger(_LOGFILEPATH);

            _serviceLogger.Write("cake schedule service");

            Assert.That(File.Exists(_LOGFILEPATH), Is.EqualTo(true));
        }
 public CakeScheduleService()
 {
     InitializeComponent();
     _mailService = new MailService(_departmentServices, _appConfigReader, DateTime.Now.Date);
     _cakeSheduleDao = new CakeScheduleDao(_appConfigReader.RepositoryPath);
     _departmentDao = new DepartmentDao(_appConfigReader.RepositoryPath);
     _scheduleWorker = new ScheduleWorker(_cakeScheduleServices, _departmentServices, _mailService,
                                          _cakeSheduleDao, _departmentDao, _appConfigReader);
     _serviceLogger = new ServiceLogger(_appConfigReader.LogPath);
     _scheduleWorker.CakeScheduleFinished += ScheduleFinished;
 }
        public void Write_FolderInLogFilePathDoesNotExist_ShouldNotThrowException()
        {
            _serviceLogger = new ServiceLogger(@"c:\NotExistingFolder\CakeScheduleService.log");

            Assert.DoesNotThrow(() => _serviceLogger.Write("Some message"));
        }