示例#1
0
        public void GivenVROfLowerCase_WhenFormalizing_ThenVRShouldBeUpperCase()
        {
            DicomTag       tag        = DicomTag.DeviceLabel;
            CustomTagEntry entry      = new CustomTagEntry(tag.GetPath(), tag.GetDefaultVR().Code.ToLowerInvariant(), CustomTagLevel.Instance, CustomTagStatus.Added);
            CustomTagEntry normalized = entry.Normalize();

            Assert.Equal(entry.VR.ToUpperInvariant(), normalized.VR);
        }
示例#2
0
        public void GivenStandardTagWithoutVR_WhenFormalizing_ThenVRShouldBeFilled(string vr)
        {
            DicomTag       tag        = DicomTag.DeviceSerialNumber;
            CustomTagEntry entry      = new CustomTagEntry(tag.GetPath(), vr, CustomTagLevel.Instance, CustomTagStatus.Added);
            CustomTagEntry normalized = entry.Normalize();

            Assert.Equal(tag.GetDefaultVR().Code, normalized.VR);
        }
示例#3
0
        public void GivenValidCustomTagEntry_WhenFormalizing_ThenShouldReturnSameEntry(CustomTagEntry entry)
        {
            CustomTagEntry normalized = entry.Normalize();

            Assert.Equal(entry.Path, normalized.Path);
            Assert.Equal(entry.VR, normalized.VR);
            Assert.Equal(entry.Level, normalized.Level);
        }
示例#4
0
        public void GivenStandardTagAsKeyword_WhenFormalizing_ThenVRShouldBeFilled()
        {
            DicomTag       tag          = DicomTag.DeviceSerialNumber;
            CustomTagEntry entry        = new CustomTagEntry(path: tag.DictionaryEntry.Keyword, tag.GetDefaultVR().Code, CustomTagLevel.Instance, CustomTagStatus.Added);
            string         expectedPath = tag.GetPath();
            CustomTagEntry normalized   = entry.Normalize();

            Assert.Equal(normalized.Path, expectedPath);
        }
示例#5
0
        public void GivenStandardTagWithVR_WhenFormalizing_ThenVRShouldNotBeUpdated()
        {
            DicomTag       tag        = DicomTag.DeviceSerialNumber;
            string         vr         = DicomVR.CS.Code;
            CustomTagEntry entry      = new CustomTagEntry(tag.GetPath(), vr, CustomTagLevel.Instance, CustomTagStatus.Added);
            CustomTagEntry normalized = entry.Normalize();

            Assert.Equal(vr, normalized.VR);
        }