Beispiel #1
0
        private static void Main(string[] args)
        {
            const int numberOfWordsForABook = 100;
            var       aBook = GenerateABook(numberOfWordsForABook);

            var lazyBookParserProxy = new LazyBookParserProxy(aBook);

            Console.WriteLine(
                "Number of words in a book is {0} (which is {1})",
                lazyBookParserProxy.GetNumberOfWords(),
                lazyBookParserProxy.GetNumberOfWords() == numberOfWordsForABook ? "correct" : "not correct"
                );
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var book  = new TheManAndTheFly();
            var proxy = new LazyBookParserProxy(book);

            Console.WriteLine(CheckFor(proxy._bookParser));
            proxy.GetNumberOfWords();
            Console.WriteLine(CheckFor(proxy._bookParser));
        }