Example #1
0
        private static void Example3()
        {
            var myRenderer = new PatternRenderer();

            var patterns = new List <Pattern>
            {
                new Pattern {
                    Id = 1, Name = "Pattern One", Description = "Pattern One Description"
                },
                new Pattern {
                    Id = 2, Name = "Pattern Two", Description = "Pattern Two Description"
                }
            };

            Console.Write(myRenderer.ListPatterns(patterns));
        }
        public static void Main()
        {
            // Run Adapter Pattern
            var MyRenderer = new PatternRenderer();

            var myList = new List <Pattern>()
            {
                new Pattern()
                {
                    Id = 1, Name = "Adapter test 1", Description = "Description Test 1"
                },
                new Pattern()
                {
                    Id = 2, Name = "Adapter test 2", Description = "Description Test 2"
                }
            };

            string result = MyRenderer.ListPatterns(myList);
        }
Example #3
0
        public void Run()
        {
            // Run Adapter Pattern
            var MyRenderer = new PatternRenderer();

            var myList = new List <Pattern>()
            {
                new Pattern()
                {
                    Id = 1, Name = "Adapter test 1", Description = "Description Test 1"
                },
                new Pattern()
                {
                    Id = 2, Name = "Adapter test 2", Description = "Description Test 2"
                }
            };

            Console.WriteLine(MyRenderer.ListPatterns(myList));
        }
Example #4
0
        public void RenderOnePattern()
        {
            var myRenderer = new PatternRenderer();
            var myList     = new List <Pattern>
            {
                new Pattern {
                    Id = 1, Name = "Pattern One", Description = "Pattern One Description"
                },
                new Pattern {
                    Id = 2, Name = "Pattern Two", Description = "Pattern Two Description"
                }
            };

            string result = myRenderer.ListPatterns(myList);

            Console.Write(result);

            int lineCount = result.Count(c => c == '\n');

            Assert.AreEqual(myList.Count + 2, lineCount);
        }