예제 #1
0
        public void TestDetermineSizeWithInvalidValue()
        {
            int width = 1000, height = 2000;
            HtmlImageCreator creator = new HtmlImageCreator();

            creator.ReadSizeFromTemplate("<!-- size: one hundred, 200 --><html>{name}</html>", ref width, ref height);
            AssertEqual(1000, width);
            AssertEqual(2000, height);
        }
예제 #2
0
        public void TestDetermineSizeMixedCase()
        {
            int width = 1000, height = 2000;
            HtmlImageCreator creator = new HtmlImageCreator();

            creator.ReadSizeFromTemplate("<!-- SiZe: 100, 200 --><html>{name}</html>", ref width, ref height);
            AssertEqual(100, width);
            AssertEqual(200, height);
        }
예제 #3
0
        public void TestDetermineSizeWithOddWhitespace()
        {
            int width = 1000, height = 2000;
            HtmlImageCreator creator = new HtmlImageCreator();

            creator.ReadSizeFromTemplate("<!--     size:\n\n\t100,200\t--><html>{name}</html>", ref width, ref height);
            AssertEqual(100, width);
            AssertEqual(200, height);
        }
예제 #4
0
        /// <summary>
        /// This test will fail if the default values are changed
        /// </summary>
        public void TestDetermineSizeNotDefined()
        {
            int width = 0, height = 0;
            HtmlImageCreator creator = new HtmlImageCreator();

            creator.ReadSizeFromTemplate("<html>{name}</html>", ref width, ref height);
            AssertEqual(0, width);
            AssertEqual(0, height);
        }