示例#1
0
        public void DicomTagPathTests()
        {
            DicomTagPath path = new PathTest();

            ((PathTest)path).SetPath("(0010,0010)");

            Assert.AreEqual(path, "(0010,0010)");
            Assert.AreEqual(path, (uint)0x00100010);
            Assert.AreEqual(path, NewDicomTag(0x00100010));
            Assert.IsTrue(path.Equals("(0010,0010)"));
            Assert.IsTrue(path.Equals((uint)0x00100010));
            Assert.IsTrue(path.Equals(NewDicomTag(0x00100010)));

            ((PathTest)path).SetPath("(0054,0220)\\(0054,0222)");
            Assert.AreEqual(path, "(0054,0220)\\(0054,0222)");
            Assert.IsFalse(path.Equals("(0054,0220)"));
            Assert.IsFalse(path.Equals((uint)0x00540220));
            Assert.IsFalse(path.Equals(NewDicomTag(0x00540220)));

            ((PathTest)path).SetPath("(0054,0220)\\(0054,0222)\\(0010,0022)");
            Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)\\(0010,0022)");

            path = new PathTest();
            ((PathTest)path).SetPath(new List <DicomTag>(new DicomTag[] { NewDicomTag(0x00540220) }));
            Assert.AreEqual(path.ToString(), "(0054,0220)");

            ((PathTest)path).SetPath(new List <DicomTag>(new DicomTag[] { NewDicomTag(0x00540220), NewDicomTag(0x00540222) }));
            Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)");

            ((PathTest)path).SetPath(new List <DicomTag>(new DicomTag[] { NewDicomTag(0x00540220), NewDicomTag(0x00540222), NewDicomTag(0x00100022) }));
            Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)\\(0010,0022)");

            path = new DicomTagPath(new uint[] { 0x00540220, 0x00540222 });
            Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)");

            path = new DicomTagPath(new uint[] { 0x00540220, 0x00540222, 0x00100010 });
            Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)\\(0010,0010)");
        }
示例#2
0
		public void DicomTagPathTests()
		{
			DicomTagPath path = new PathTest();
			((PathTest)path).SetPath("(0010,0010)");

			Assert.AreEqual(path, "(0010,0010)"); 
			Assert.AreEqual(path, (uint)0x00100010);
			Assert.AreEqual(path, NewDicomTag(0x00100010));
			Assert.IsTrue(path.Equals("(0010,0010)"));
			Assert.IsTrue(path.Equals((uint)0x00100010));
			Assert.IsTrue(path.Equals(NewDicomTag(0x00100010)));

			((PathTest)path).SetPath("(0054,0220)\\(0054,0222)");
			Assert.AreEqual(path, "(0054,0220)\\(0054,0222)"); 
			Assert.IsFalse(path.Equals("(0054,0220)"));
			Assert.IsFalse(path.Equals((uint)0x00540220));
			Assert.IsFalse(path.Equals(NewDicomTag(0x00540220)));

			((PathTest)path).SetPath("(0054,0220)\\(0054,0222)\\(0010,0022)");
			Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)\\(0010,0022)");

			path = new PathTest();
			((PathTest)path).SetPath(new List<DicomTag>(new DicomTag[] { NewDicomTag(0x00540220) }));
			Assert.AreEqual(path.ToString(), "(0054,0220)");

			((PathTest)path).SetPath(new List<DicomTag>(new DicomTag[] { NewDicomTag(0x00540220), NewDicomTag(0x00540222) }));
			Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)");

			((PathTest)path).SetPath(new List<DicomTag>(new DicomTag[] { NewDicomTag(0x00540220), NewDicomTag(0x00540222), NewDicomTag(0x00100022) }));
			Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)\\(0010,0022)");

			path = new DicomTagPath(new uint[] { 0x00540220, 0x00540222 });
			Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)");

			path = new DicomTagPath(new uint[] { 0x00540220, 0x00540222, 0x00100010 });
			Assert.AreEqual(path.ToString(), "(0054,0220)\\(0054,0222)\\(0010,0010)");
		}