public void GetAllFiles_returns_all_valid_files_based_on_configured_filetypes(IEnumerable <string> filesList, int countOfFiles) { //given moqFolderParserService.Setup(m => m.GetFileNamesFromFolder(It.IsAny <string>(), It.Is <string>(p => p == "*.csv"))).Returns(filesList); var sut = new FolderManager(moqFolderParserService.Object); var fileTypes = new Dictionary <string, string>() { { "TOU", "Energy" }, { "LP", "Data Value" } }; var sourceFolderPath = "D:\\Sample files"; var fileFormat = "*.csv"; //when var actual = sut.GetAllFiles(sourceFolderPath, fileFormat, fileTypes); //then int countReturned = actual == null ? 0 : actual.Count(); Assert.Equal(countOfFiles, countReturned); moqFolderParserService.Verify(v => v.GetFileNamesFromFolder(It.IsAny <string>(), It.Is <string>(p => p == "*.csv")), Times.Once); }