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); }
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); }
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); }
/// <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); }