diff --git a/DicomTypeTranslation.Tests/BsonTranslationTests.cs b/DicomTypeTranslation.Tests/BsonTranslationTests.cs index 21f57ce..14e3b56 100644 --- a/DicomTypeTranslation.Tests/BsonTranslationTests.cs +++ b/DicomTypeTranslation.Tests/BsonTranslationTests.cs @@ -42,8 +42,7 @@ public void DicomToBson_TranslateEmptyElements_TagsRetainedValuesNull() [Test] public void DicomToBson_TranslateNormalDataset_DoesNotThrow() { - DicomDataset ds = TranslationTestHelpers.BuildVrDataset(); - Assert.DoesNotThrow(() => DicomTypeTranslaterReader.BuildBsonDocument(ds)); + Assert.DoesNotThrow(() => DicomTypeTranslaterReader.BuildBsonDocument(TranslationTestHelpers.BuildVrDataset())); } [Test] diff --git a/DicomTypeTranslation.Tests/DicomTypeTranslatorTests.cs b/DicomTypeTranslation.Tests/DicomTypeTranslatorTests.cs index b0a7250..e928eb1 100644 --- a/DicomTypeTranslation.Tests/DicomTypeTranslatorTests.cs +++ b/DicomTypeTranslation.Tests/DicomTypeTranslatorTests.cs @@ -68,7 +68,7 @@ public void TestSequenceConversion() Assert.AreEqual(2, asArray[0].Count); Assert.AreEqual("short desc", asArray[0][DicomTag.SpecimenShortDescription]); - Assert.AreEqual("99Y", asArray[0][DicomTag.PatientAge]); + Assert.AreEqual("099Y", asArray[0][DicomTag.PatientAge]); } [Test] @@ -97,7 +97,7 @@ public void TestMultipleElementSequences() // Hemodynamic Waveform Storage class UID, plus counter {DicomTag.ReferencedSOPClassUID, $"1.2.840.10008.5.1.4.1.1.9.2.1.{(i + 1)}" }, // Truncated example instance UID from dicom.innolytics.com, plus counter - {DicomTag.ReferencedSOPInstanceUID, $"1.3.6.1.4.1.14519.5.2.1.7695.2311.916784049-{(i + 1)}" } + {DicomTag.ReferencedSOPInstanceUID, $"1.3.6.1.4.1.14519.5.2.1.7695.2311.916784049.{(i + 1)}" } }); } @@ -209,12 +209,12 @@ public void PrintValueTypesForVrs() [Test] public void TestGetCSharpValueThrowsException() { - var ds = new DicomDataset - { - new DicomDecimalString(DicomTag.SelectorDSValue, "aaahhhhh") - }; - - Assert.Throws(() => DicomTypeTranslaterReader.GetCSharpValue(ds, DicomTag.SelectorDSValue)); + Assert.Throws(() => DicomTypeTranslaterReader.GetCSharpValue( + new DicomDataset + { + new DicomDecimalString(DicomTag.SelectorDSValue, "aaahhhhh") + }, + DicomTag.SelectorDSValue)); } diff --git a/DicomTypeTranslation.Tests/Helpers/TranslationTestHelpers.cs b/DicomTypeTranslation.Tests/Helpers/TranslationTestHelpers.cs index 5c32ee4..674a596 100644 --- a/DicomTypeTranslation.Tests/Helpers/TranslationTestHelpers.cs +++ b/DicomTypeTranslation.Tests/Helpers/TranslationTestHelpers.cs @@ -26,7 +26,7 @@ public static DicomDataset BuildVrDataset(DicomVR singleVr = null) var ds = new DicomDataset { new DicomApplicationEntity(DicomTag.RetrieveAETitle, "AppEntity-1", "AppEntity-2"), - new DicomAgeString(DicomTag.PatientAge, "34y", "32y"), + new DicomAgeString(DicomTag.PatientAge, "034y", "032y"), new DicomAttributeTag(DicomTag.SelectorATValue, DicomTag.SOPInstanceUID, DicomTag.SeriesInstanceUID), new DicomCodeString(DicomTag.QualityControlImage, "FOOBAR", "OOFRAB"), new DicomDate(DicomTag.AcquisitionDate, "20000229", "20180401"), @@ -54,7 +54,7 @@ public static DicomDataset BuildVrDataset(DicomVR singleVr = null) }), new DicomSignedShort(DicomTag.SelectorSSValue, 0, short.MinValue, short.MaxValue), new DicomShortText(DicomTag.SelectorSTValue, "Short\\Text\\Backslashes should be ok: \\\\\\"), - new DicomSignedVeryLong(DicomTag.SelectorSVValue,0), // NOTE(rkm 2020-03-25) No tags actually have this VR yet! JS 2022-03-18 there are now... + new DicomSignedVeryLong(DicomTag.SelectorSVValue,1,7), // NOTE(rkm 2020-03-25) No tags actually have this VR yet! JS 2022-03-18 there are now... new DicomTime(DicomTag.SelectorTMValue, "123456", "235959"), new DicomUnlimitedCharacters(DicomTag.SelectorUCValue, "UnlimitedCharacters-1"), new DicomUniqueIdentifier(DicomTag.SelectorUIValue, "1.2.3.4", "5.6.7.8"), @@ -63,7 +63,7 @@ public static DicomDataset BuildVrDataset(DicomVR singleVr = null) new DicomUniversalResource(DicomTag.URNCodeValue, "http://example.com?q=1"), new DicomUnsignedShort(DicomTag.SelectorUSValue, 0, 1, ushort.MaxValue), new DicomUnlimitedText(DicomTag.SelectorUTValue, "unlimited!"), - new DicomUnsignedVeryLong(DicomTag.SelectorUVValue,0), // NOTE(rkm 2020-03-25) No tags actually have this VR yet! JS 2022-03-18 there are now... + new DicomUnsignedVeryLong(DicomTag.SelectorUVValue,new UInt64[]{1}), // NOTE(rkm 2020-03-25) No tags actually have this VR yet! JS 2022-03-18 there are now... }; if (singleVr != null)