Пример #1
0
        public void TestFindLine()
        {
            SandwichCode sandwich = new SandwichCode();
            string       line     = sandwich.FindLine("example_file.txt");

            Assert.AreEqual(string.Empty, line);
        }
Пример #2
0
        public void TestCountLines_UsingLambda()
        {
            SandwichCode sandwich = new SandwichCode();
            int          count    = sandwich.CountLines_UsingLambda("example_file.txt");

            Assert.AreEqual(0, count);
        }
Пример #3
0
        public void TestFindLine_UsingLambda()
        {
            SandwichCode sandwich = new SandwichCode();
            string       line     = null;

            sandwich.FileByLineReader("example_file.txt", (s) =>
            {
                bool found = s.Contains("e");
                if (found)
                {
                    line = s;
                    return(false);
                }
                return(true);
            });
            Assert.AreEqual(string.Empty, line);
        }