public void RenameTest_Case_FileAlreadyExists() { const string p = nameof(RenameTest_Case_FileAlreadyExists); TestContext.Progress.WriteLine($"{p} START"); var path = Path.Combine(settings.DownloadsPath, "The.Big.Bang.Theory.S10E01.FASTSUB.VOSTFR.HDTV.x264-FDS.mp4"); TestHelper.CreateFile(path); var alreadyExistingFilePath = Path.Combine( settings.MediaLibraryPath, "TV Shows", "The Big Bang Theory", "Season 10", "The Big Bang Theory - S10E01 - The Conjugal Conjecture.mp4"); TestHelper.CreateFile(alreadyExistingFilePath); var loggerMock = new Mock <ILogger <IFilebotService> >(); var filebot = new FilebotService(loggerMock.Object); var result = filebot.Rename(new RenameRequest { Path = path, BaseDestPath = settings.MediaLibraryPath }); Assert.IsTrue(result.Succeeded, $"Failed to rename using Filebot{Environment.NewLine + result.ToStringOfProperties()}"); Assert.AreEqual(alreadyExistingFilePath, result.DestPath); }
public void RenameTest_Case_Failure() { var path = Path.Combine(settings.DownloadsPath, Guid.NewGuid().ToString("N") + ".mp4"); TestHelper.CreateFile(path); var loggerMock = new Mock <ILogger <IFilebotService> >(); var filebot = new FilebotService(loggerMock.Object); var result = filebot.Rename(new RenameRequest { Path = path, BaseDestPath = settings.MediaLibraryPath }); Assert.IsFalse(result.Succeeded, $"Filebot should not have succeeded{Environment.NewLine + result.ToStringOfProperties()}"); }