public void GivenPrivateIdentificationCodeTagWithoutVR_WhenNormalizing_ThenVRShouldBeFilled() { AddExtendedQueryTagEntry entry = CreateExtendedQueryTagEntry("22010010", null, null, QueryTagLevel.Instance); AddExtendedQueryTagEntry normalized = entry.Normalize(); Assert.Equal(DicomVRCode.LO, normalized.VR); }
public void GivenInvalidTagWithoutVR_WhenNormalizing_ThenShouldNotThrowException() { // Add this unit test for regression: we had a bug when tag is valid and VR is null, NullPointerException is thrown. More details can be found https://microsofthealth.visualstudio.com/Health/_workitems/edit/81015 AddExtendedQueryTagEntry entry = CreateExtendedQueryTagEntry(path: "00111011", null, null, QueryTagLevel.Series); entry.Normalize(); }
public void GivenVROfLowerCase_WhenNormalizing_ThenVRShouldBeUpperCase() { DicomTag tag = DicomTag.DeviceLabel; AddExtendedQueryTagEntry entry = CreateExtendedQueryTagEntry(tag.GetPath(), tag.GetDefaultVR().Code.ToLowerInvariant(), null, QueryTagLevel.Instance); AddExtendedQueryTagEntry normalized = entry.Normalize(); Assert.Equal(entry.VR.ToUpperInvariant(), normalized.VR); }
public void GivenStandardTagWithoutVR_WhenNormalizing_ThenVRShouldBeFilled(string vr) { DicomTag tag = DicomTag.DeviceSerialNumber; AddExtendedQueryTagEntry entry = CreateExtendedQueryTagEntry(tag.GetPath(), vr, null, QueryTagLevel.Instance); AddExtendedQueryTagEntry normalized = entry.Normalize(); Assert.Equal(tag.GetDefaultVR().Code, normalized.VR); }
public void GivenValidExtendedQueryTagEntry_WhenNormalizing_ThenShouldReturnSameEntry(AddExtendedQueryTagEntry entry) { AddExtendedQueryTagEntry normalized = entry.Normalize(); Assert.Equal(entry.Path, normalized.Path); Assert.Equal(entry.VR, normalized.VR); Assert.Equal(entry.Level, normalized.Level); }
public void GivenStandardTagAsKeyword_WhenNormalizing_ThenVRShouldBeFilled() { DicomTag tag = DicomTag.DeviceSerialNumber; AddExtendedQueryTagEntry entry = CreateExtendedQueryTagEntry(path: tag.DictionaryEntry.Keyword, tag.GetDefaultVR().Code, null, QueryTagLevel.Instance); string expectedPath = tag.GetPath(); AddExtendedQueryTagEntry normalized = entry.Normalize(); Assert.Equal(normalized.Path, expectedPath); }
public void GivenStandardTagWithVR_WhenNormalizing_ThenVRShouldNotBeUpdated() { DicomTag tag = DicomTag.DeviceSerialNumber; string vr = DicomVR.CS.Code; AddExtendedQueryTagEntry entry = CreateExtendedQueryTagEntry(tag.GetPath(), vr, null, QueryTagLevel.Instance); AddExtendedQueryTagEntry normalized = entry.Normalize(); Assert.Equal(vr, normalized.VR); }