public void TestElementWithParams() { var elem = new SsmlEmphasis("words", SsmlEmphasis.LevelEnum.Strong); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<emphasis level=\"strong\">words</emphasis>", elem.ToString() ); }
public void TestEmptyElement() { var elem = new SsmlEmphasis(); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<emphasis></emphasis>", elem.ToString() ); }
public void TestElementWithTextNode() { var elem = new SsmlEmphasis(); elem.AddText("Here is the content"); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<emphasis>Here is the content</emphasis>", elem.ToString() ); }
public void TestElementWithExtraAttributes() { var elem = new SsmlEmphasis(); elem.SetOption("newParam1", "value"); elem.SetOption("newParam2", 1); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<emphasis newParam1=\"value\" newParam2=\"1\"></emphasis>", elem.ToString() ); }
public void TestMixedContent() { var elem = new SsmlEmphasis(); elem.AddText("before") .AddChild("Child").AddText("content"); elem.AddText("after"); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<emphasis>before<Child>content</Child>after</emphasis>", elem.ToString() ); }
public void TestAllowGenericChildNodes() { var elem = new SsmlEmphasis(); elem.AddChild("generic-tag").AddText("Content").SetOption("tag", true); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<emphasis>" + Environment.NewLine + " <generic-tag tag=\"True\">Content</generic-tag>" + Environment.NewLine + "</emphasis>", elem.ToString() ); }