Esempio n. 1
0
 public void SinglePropertyAndIndexer()
 {
   JPath path = new JPath("Blah[0]");
   Assert.AreEqual(2, path.Parts.Count);
   Assert.AreEqual("Blah", path.Parts[0]);
   Assert.AreEqual(0, path.Parts[1]);
 }
Esempio n. 2
0
 public void TwoProperties()
 {
   JPath path = new JPath("Blah.Two");
   Assert.AreEqual(2, path.Parts.Count);
   Assert.AreEqual("Blah", path.Parts[0]);
   Assert.AreEqual("Two", path.Parts[1]);
 }
Esempio n. 3
0
 public void MultiplePropertiesAndIndexers()
 {
   JPath path = new JPath("Blah[0].Two.Three[1].Four");
   Assert.AreEqual(6, path.Parts.Count);
   Assert.AreEqual("Blah", path.Parts[0]);
   Assert.AreEqual(0, path.Parts[1]);
   Assert.AreEqual("Two", path.Parts[2]);
   Assert.AreEqual("Three", path.Parts[3]);
   Assert.AreEqual(1, path.Parts[4]);
   Assert.AreEqual("Four", path.Parts[5]);
 }
Esempio n. 4
0
 public void SingleProperty()
 {
   JPath path = new JPath("Blah");
   Assert.AreEqual(1, path.Parts.Count);
   Assert.AreEqual("Blah", path.Parts[0]);
 }
Esempio n. 5
0
 public void AdjacentIndexers()
 {
   JPath path = new JPath("[1][0][0][" + int.MaxValue + "]");
   Assert.AreEqual(4, path.Parts.Count);
   Assert.AreEqual(1, path.Parts[0]);
   Assert.AreEqual(0, path.Parts[1]);
   Assert.AreEqual(0, path.Parts[2]);
   Assert.AreEqual(int.MaxValue, path.Parts[3]);
 }
Esempio n. 6
0
 public void IndexerOnly()
 {
   JPath path = new JPath("[111119990]");
   Assert.AreEqual(1, path.Parts.Count);
   Assert.AreEqual(111119990, path.Parts[0]);
 }
Esempio n. 7
0
 public void AdditionalDots()
 {
   JPath path = new JPath(".Blah..[0]..Two.Three....[1].Four.");
   Assert.AreEqual(6, path.Parts.Count);
   Assert.AreEqual("Blah", path.Parts[0]);
   Assert.AreEqual(0, path.Parts[1]);
   Assert.AreEqual("Two", path.Parts[2]);
   Assert.AreEqual("Three", path.Parts[3]);
   Assert.AreEqual(1, path.Parts[4]);
   Assert.AreEqual("Four", path.Parts[5]);
 }