示例#1
0
        public void emptyFileTest()
        {
            var testName = new List <Person> {
            };
            var people   = NamesImporter.importNames("../../../test-samples/blank.txt");

            Assert.Equal(testName, people);
        }
示例#2
0
        public void basicReadTest()
        {
            var firstNames = new List <String> {
                "Janet",
                "Vaughn",
                "Adonis Julius",
                "Shelby Nathan",
                "Marin",
                "London",
                "Beau Tristan",
                "Leo",
                "Hunter Uriah Mathew",
                "Mikayla",
                "Frankie Conner"
            };
            var lastNames = new List <String> {
                "Parsons",
                "Lewis",
                "Archer",
                "Yoder",
                "Alvarez",
                "Lindsey",
                "Bentley",
                "Gardner",
                "Clarke",
                "Lopez",
                "Ritter"
            };
            var people = new List <Person> {
            };

            for (int i = 0; i < firstNames.Count; ++i)
            {
                people.Add(new Person(firstNames[i], lastNames[i]));
            }
            var testNames = NamesImporter.importNames("../../../test-samples/simple-names.txt");

            Assert.Equal(testNames, people);
        }
示例#3
0
 public void noPermissionTest()
 {
     Assert.Throws <InvalidNamesFileException>(() => NamesImporter.importNames("../../../test-samples/no-permission.txt"));
 }
示例#4
0
 public void invalidNameTest()
 {
     Assert.Throws <InvalidNamesFileException>(() => NamesImporter.importNames("../../../test-samples/no-first.txt"));
 }