Exemple #1
0
        public void DicomValueElement_HasData_GetNullableReturnsDefinedNullable()
        {
            const ushort expected = 1;
            var          element  = new DicomUnsignedShort(DicomTag.ALinesPerFrame, expected);
            var          actual   = element.Get <ushort?>().Value;

            Assert.Equal(expected, actual);
        }
Exemple #2
0
        public void DicomUnsignedShortTest()
        {
            ushort[] testValues = new ushort[] { 1, 2, 3, 4, 5 };

            var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumbersRETIRED, testValues);

            TestAddElementToDatasetAsString <ushort>(element, testValues);
        }
Exemple #3
0
        public void DicomUnsignedShort_Array_ExplicitMinus2Throws()
        {
            var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumbers, 1, 2, 3, 4, 5);

            Assert.Throws <ArgumentOutOfRangeException>(() => element.Get <ushort>(-2));
        }
Exemple #4
0
        public void DicomUnsignedShort_Array_ExplicitMinus1InterpretAs0()
        {
            var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumbers, 1, 2, 3, 4, 5);

            Assert.Equal(element.Get <ushort>(-1), element.Get <ushort>(0));
        }
Exemple #5
0
        public void DicomUnsignedShortAsDicomElement_Array_GetObjectArrayValue()
        {
            DicomElement element = new DicomUnsignedShort(DicomTag.SynchronizationChannel, 5, 8);

            Assert.Equal(new object[] { (ushort)5, (ushort)8 }, element.Get <object[]>());
        }