예제 #1
0
        public void GivenPrivateIdentificationCodeTagWithoutVR_WhenNormalizing_ThenVRShouldBeFilled()
        {
            AddExtendedQueryTagEntry entry      = CreateExtendedQueryTagEntry("22010010", null, null, QueryTagLevel.Instance);
            AddExtendedQueryTagEntry normalized = entry.Normalize();

            Assert.Equal(DicomVRCode.LO, normalized.VR);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }