Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        public void ParseTag_Empty()
        {
            var tag = OuyaUtils.ParseTag("Foo [] Baz");

            Assert.IsNull(tag);
        }
Example #6
0
        public void ParseTag_WhenWholeTagIsBroken()
        {
            var tag = OuyaUtils.ParseTag("Foo [Foo (Bar");

            Assert.IsNull(tag);
        }