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); }
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); }
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); }
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); }
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); }