Пример #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);
        }
Пример #2
0
 public void DicomUnsignedShort_Array_ExplicitMinus2Throws()
 {
     var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumbers, 1, 2, 3, 4, 5);
     Assert.Throws<ArgumentOutOfRangeException>(() => element.Get<ushort>(-2));
 }
Пример #3
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));
 }
Пример #4
0
        public void DicomUnsignedShort_Array_ExplicitMinus2Throws()
        {
            var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumber, 1, 2, 3, 4, 5);

            Assert.Throws <ArgumentOutOfRangeException>(() => element.Get <ushort>(-2));
        }
Пример #5
0
        public void DicomUnsignedShort_Array_ExplicitMinus1InterpretAs0()
        {
            var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumber, 1, 2, 3, 4, 5);

            Assert.Equal(element.Get <ushort>(-1), element.Get <ushort>(0));
        }
Пример #6
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[]>());
        }