Esempio n. 1
0
        public static void RunExample2()
        {
            List <Car> cars = new List <Car>()
            {
                new Car()
                {
                    Brand    = "Dodge",
                    Model    = "Charger",
                    Year     = 1966,
                    Price    = 13500,
                    Currency = "USD"
                },
                new Car()
                {
                    Brand    = "Hummer",
                    Model    = "H2",
                    Year     = 2001,
                    Price    = 24200,
                    Currency = "USD"
                }
            };

            IMarkdownTabulizer markdownTabulizer = new MarkdownTabulizer();
            string             markdownTable
                = markdownTabulizer.ToMarkdownTable(
                      false,
                      NullHandlingStrategies.ThrowException,
                      cars);

            Console.WriteLine(markdownTable);
        }
        public void ToMarkdownTableList_ShouldReturnExpectedString_WhenProperArguments <T>
            (bool smallerFontSize, NullHandlingStrategies strategy, List <T> rows, string expected)
        {
            // Arrange
            // Act
            string actual = new MarkdownTabulizer().ToMarkdownTable(smallerFontSize, strategy, rows);

            // Assert
            Assert.AreEqual(expected, actual);
        }
        public void ToMarkdownTableObject_ShouldReturnExpectedString_WhenProperArguments <T>
            (bool smallerFontSize, T obj, string expected)
        {
            // Arrange
            // Act
            string actual = new MarkdownTabulizer().ToMarkdownTable(smallerFontSize, obj);

            // Assert
            Assert.AreEqual(expected, actual);
        }
        public void ToMarkdownHeader_ShouldReturnExpectedString_WhenProperArguments
            (bool smallerFontSize, string[] values, string expected)
        {
            // Arrange
            // Act
            string actual = new MarkdownTabulizer().ToMarkdownHeader(smallerFontSize, values);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 5
0
        public static void RunExample1()
        {
            Car car = new Car()
            {
                Brand    = "Dodge",
                Model    = "Charger",
                Year     = 1966,
                Price    = 13500,
                Currency = "USD"
            };

            IMarkdownTabulizer markdownTabulizer = new MarkdownTabulizer();
            string             markdownTable     = markdownTabulizer.ToMarkdownTable(false, car);

            Console.WriteLine(markdownTable);
        }