Esempio n. 1
0
        public void Retrieve_FileFound_ReturnsFileContents()
        {
            var    retriever = new CustomWordListRetriever();
            string result    = retriever.Retrieve(FullCustomFileName);

            Assert.AreEqual(FileContents, result);
        }
Esempio n. 2
0
        public void Retrieve_WithMappedPathFileFound_ReturnsFileContents()
        {
            Func <string, string> mapPath = (path) => CustomFilePath + path;
            var    retriever = new CustomWordListRetriever(mapPath);
            string result    = retriever.Retrieve(FileName);

            Assert.AreEqual(FileContents, result);
        }
Esempio n. 3
0
 public void Retrieve_FileError_ThrowsException()
 {
     using (var fs = new FileStream(FullCustomFileName, FileMode.Open, FileAccess.Read, FileShare.None))
     {
         var retriever = new CustomWordListRetriever();
         retriever.Retrieve(FullCustomFileName);
     }
 }
Esempio n. 4
0
        public void Retrieve_FileDoesntExist_ThrowsException()
        {
            var retriever = new CustomWordListRetriever();

            retriever.Retrieve("I-dont-exist.txt");
        }
Esempio n. 5
0
        public void Retrieve_NullFileName_ThrowsException()
        {
            var retriever = new CustomWordListRetriever();

            retriever.Retrieve(null);
        }