Пример #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));
        }