Beispiel #1
0
        public void SetUp()
        {
            string tempPath = Path.GetTempPath();

            _fileToMonitor1 = Path.Combine(tempPath, "fileToMonitor1");
            _fileToMonitor2 = Path.Combine(tempPath, "fileToMonitor2");

            _fileStoreMock = new Mock <IFileStore>();
            _loggerMock    = new Mock <ILogger>();

            Dictionary <string, string> filePathsToMonitor = GetFilePathsToMonitor();

            _fileBackupProvider = new FileBackupProvider(_fileStoreMock.Object, _loggerMock.Object);
            _fileBackupProvider.Initialize(filePathsToMonitor);
        }
Beispiel #2
0
        public void ExceptionRaisedWhenNullFileListIsProvidedOtherCtr()
        {
            var anotherFileBackupProvider = new FileBackupProvider(_fileStoreMock.Object, _loggerMock.Object);

            Assert.That(() => anotherFileBackupProvider.Initialize((IEnumerable <IConfigItem>)null), Throws.Exception.TypeOf <ArgumentNullException>());
        }
Beispiel #3
0
        public void ExceptionRaisedWhenNullFileListIsProvided()
        {
            var anotherFileBackupProvider = new FileBackupProvider(_fileStoreMock.Object, _loggerMock.Object);

            Assert.That(() => anotherFileBackupProvider.Initialize((Dictionary <string, string>)null), Throws.Exception.TypeOf <ArgumentNullException>());
        }