Esempio n. 1
0
        public void ShouldHandlePurgingExceptionsGracefully()
        {
            IFileSystem fileSystemMock = FileSystemMockingUtils.MockFileSystem(fileMock =>
            {
                // not needed
            },
                                                                               directoryMock =>
            {
                directoryMock.Setup(dir => dir.GetFiles(Path.Combine(TraceDirectory, "empty-traces"))).Throws <IOException>();
            }
                                                                               ).Object;

            new Archive(TraceDirectory, fileSystemMock, dateTimeProvider.Object).PurgeEmptyFiles(TimeSpan.FromDays(42));
        }
Esempio n. 2
0
        public void ShouldHandleArchivingExceptionsGracefully()
        {
            IFileSystem fileSystemMock = FileSystemMockingUtils.MockFileSystem(fileMock =>
            {
                fileMock.Setup(file => file.ReadAllLines(FileInTraceDirectory("coverage_1_1.txt"))).Throws <IOException>();
            },
                                                                               directoryMock =>
            {
                // not needed
            }
                                                                               ).Object;

            new Archive(TraceDirectory, fileSystemMock, dateTimeProvider.Object).ArchiveUploadedFile(FileInTraceDirectory("coverage_1_1.txt"));
        }