Exemplo n.º 1
0
        public void GetCandidates_can_get_multiple_candidates()
        {
            var path   = WriteLinesToNewPath("John", "Dave");
            var result = CandidatesSource.GetCandidates(path).Select(c => c.Name).ToArray();

            CollectionAssert.AreEqual(new[] { "John", "Dave" }, result);
        }
Exemplo n.º 2
0
        public void GetCandidates_ignores_empty_lines()
        {
            var path   = WriteLinesToNewPath("John", "", "   ", "Dave", "\t");
            var result = CandidatesSource.GetCandidates(path).Select(c => c.Name).ToArray();

            CollectionAssert.AreEqual(new[] { "John", "Dave" }, result);
        }
Exemplo n.º 3
0
        public void GetCandidates_throws_if_file_does_not_exist()
        {
            var nonExistentPath = GetPathToNonExistentFile();
            var exception       = Assert.ThrowsException <ArgumentException>(
                () => CandidatesSource.GetCandidates(nonExistentPath)
                );

            StringAssert.Contains(exception.Message, nonExistentPath);
            Assert.AreEqual("path", exception.ParamName);
        }