public void HasSameStyleTrueTest() { var a = new StyledText("abc", Color.Red); var b = new StyledText("123", a); Assert.IsTrue(a.HasSameStyle(b)); Assert.IsTrue(b.HasSameStyle(a)); }
public void HasSameStyleFalseTest() { var a = new StyledText("abc", Color.Red); var b = new StyledText("123", Color.Green); Assert.IsFalse(a.HasSameStyle(b)); Assert.IsFalse(b.HasSameStyle(a)); }
public void ConcastTestA() { var s1 = new StyledText("abcd", Color.Black); var s2 = new StyledText("123", Color.Black); var s3 = new StyledText("xyz", Color.Black); var concat = StyledText.Concat(new StyledText[] { s1, s2, s3 }); Assert.AreEqual(1, concat.Count()); Assert.AreEqual(s1.Text + s2.Text + s3.Text, concat.First().Text); Assert.IsTrue(s1.HasSameStyle(concat.First())); }
public void ConcastTestB() { var s1 = new StyledText("abcd", Color.Black); var s2 = new StyledText("123", Color.Black); var s3 = new StyledText("xyz", Color.White); var concat = StyledText.Concat(new StyledText[] { s1, s2, s3 }).ToArray(); Assert.AreEqual(2, concat.Count()); Assert.AreEqual(s1.Text + s2.Text, concat[0].Text); Assert.AreEqual(s3.Text, concat[1].Text); Assert.IsTrue(s1.HasSameStyle(concat[0])); Assert.IsTrue(s3.HasSameStyle(concat[1])); }