public async Task ArchiveLogFilesByCategory_TimeRangeNotValid_ReturnFalse(string startTime, string endTime, string message, LogLevel logLevel, LogTarget logTarget, string category) { // Arrange logService.Log(message, logTarget, logLevel, this.ToString(), "Test_Logs"); logService.Log(message, logTarget, logLevel, this.ToString(), category); IArchiveManager archiveManager = new ArchiveManager(archiveService, folderHandlerService); // Act var result = await archiveManager.ArchiveLogFilesByCategory(DateTimeOffset.Parse(startTime), DateTimeOffset.Parse(endTime), category); // Assert Assert.IsFalse(result.WasSuccessful); }
public async Task ArchiveLogFilesByCategory_LogsArchived_ReturnTrue(string message, LogLevel logLevel, LogTarget logTarget, string category) { // Arrange logService.Log(message, logTarget, logLevel, this.ToString(), "Test_Logs"); logService.Log(message, logTarget, logLevel, this.ToString(), category); var startTime = DateTimeOffset.UtcNow.AddDays(-1); var endTime = DateTimeOffset.UtcNow.AddDays(1); IArchiveManager archiveManager = new ArchiveManager(archiveService, folderHandlerService); // Act var result = await archiveManager.ArchiveLogFilesByCategory(startTime, endTime, category); // Assert Assert.IsTrue(result.WasSuccessful); }