public void If_file_doesnt_exists_throws_exception() { var fakeFomatter = new Mock<IPathFormatter>(); IFileFinder finder = new Aria2cFinder(new Aria2cConfig { Executable = "invalid path" }, fakeFomatter.Object); Assert.That(() => finder.Find(), Throws.Exception.InstanceOf<FileNotFoundException>()); }
public void Can_find_file() { string currentAssemblyPath = Assembly.GetExecutingAssembly().Location; var fakeFomatter = new Mock<IPathFormatter>(); IFileFinder finder = new Aria2cFinder(new Aria2cConfig { Executable = currentAssemblyPath, }, fakeFomatter.Object); string path = finder.Find(); Assert.That(path, Is.EqualTo(currentAssemblyPath)); }