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

            Assert.AreEqual(FileContents, result);
        }
Exemple #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);
        }
Exemple #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);
     }
 }
Exemple #4
0
        public void Retrieve_FileDoesntExist_ThrowsException()
        {
            var retriever = new CustomWordListRetriever();

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

            retriever.Retrieve(null);
        }