示例#1
0
        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>());
        }
示例#2
0
        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));
        }