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)); }
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")); }