public void ParseTag_Normal() { var tag = OuyaUtils.ParseTag("Foo [Bar] Baz"); Assert.IsNotNull(tag); Assert.AreEqual("[Bar]", tag.FullTag); Assert.AreEqual("Bar", tag.Content); Assert.AreEqual("Bar", tag.NormalizedBody); Assert.AreEqual(string.Empty, tag.NormalizedDetail); Assert.AreEqual(string.Empty, tag.NormalizedRestOfTag); Assert.AreEqual("Bar", tag.NormalizedTag); }
public void ParseTag_IncludeWhitespaces() { var tag = OuyaUtils.ParseTag("Foo [ ] Baz"); Assert.IsNotNull(tag); Assert.AreEqual("[ ]", tag.FullTag); Assert.AreEqual(" ", tag.Content); Assert.AreEqual(" ", tag.NormalizedBody); Assert.AreEqual(string.Empty, tag.NormalizedDetail); Assert.AreEqual(string.Empty, tag.NormalizedRestOfTag); Assert.AreEqual(" ", tag.NormalizedTag); }
public void ParseTag_WhenBrokenDescriptionExists() { var tag = OuyaUtils.ParseTag("Foo [Foo (Bar]"); Assert.IsNotNull(tag); Assert.AreEqual("[Foo (Bar]", tag.FullTag); Assert.AreEqual("Foo (Bar", tag.Content); Assert.AreEqual("Foo ", tag.NormalizedBody); Assert.AreEqual(string.Empty, tag.NormalizedDetail); Assert.AreEqual("(Bar", tag.NormalizedRestOfTag); Assert.AreEqual("Foo (Bar", tag.NormalizedTag); }
public void ParseTag_DescriptionExists() { var tag = OuyaUtils.ParseTag("Foo [Foo (Bar) Baz][Baz] Baz"); Assert.IsNotNull(tag); Assert.AreEqual("[Foo (Bar) Baz]", tag.FullTag); Assert.AreEqual("Foo (Bar) Baz", tag.Content); Assert.AreEqual("Foo ", tag.NormalizedBody); Assert.AreEqual("Bar", tag.NormalizedDetail); Assert.AreEqual(" Baz", tag.NormalizedRestOfTag); Assert.AreEqual("Foo (Bar) Baz", tag.NormalizedTag); }
public void ParseTag_Empty() { var tag = OuyaUtils.ParseTag("Foo [] Baz"); Assert.IsNull(tag); }
public void ParseTag_WhenWholeTagIsBroken() { var tag = OuyaUtils.ParseTag("Foo [Foo (Bar"); Assert.IsNull(tag); }