Exemple #1
0
 public void TestConstructorSetsTextProperty()
 {
     string text = "This is a test string.";
     int id = 0;
     OxmlBlock target = new OxmlBlock(text, id);
     string expected = text;
     string actual = target.Text;
     Assert.AreEqual(expected, actual);
 }
Exemple #2
0
 public void TestConstructorSetsIdProperty()
 {
     string text = "This is a test string.";
     int id = 1;
     OxmlBlock target = new OxmlBlock(text, id);
     int expected = id;
     int actual = target.Id;
     Assert.AreEqual(expected, actual);
 }
Exemple #3
0
 public void TestGenerateOxmlTokensReturnsOxmlTokens()
 {
     string text = "This is a test.";
     int id = 1;
     OxmlBlock target = new OxmlBlock(text, id);
     var expected = new OxmlToken[4];
     expected[0] = new OxmlToken("This", "this", new OxmlRange(id, 0, 4));
     expected[1] = new OxmlToken("is", "is", new OxmlRange(id, 5, 7));
     expected[2] = new OxmlToken("a", "a", new OxmlRange(id, 8, 9));
     expected[3] = new OxmlToken("test", "test", new OxmlRange(id, 10, 14));
     var actual = target.GenerateOxmlTokens();
     Assert.AreEqual(expected.GetLength(0), actual.GetLength(0));
     Assert.IsTrue(expected[0].Equals(actual[0]));
     Assert.IsTrue(expected[1].Equals(actual[1]));
     Assert.IsTrue(expected[2].Equals(actual[2]));
     Assert.IsTrue(expected[3].Equals(actual[3]));
 }