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); }
public void DicomUnsignedShortTest() { ushort[] testValues = new ushort[] { 1, 2, 3, 4, 5 }; var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumbersRETIRED, testValues); TestAddElementToDatasetAsString <ushort>(element, testValues); }
public void DicomUnsignedShort_Array_ExplicitMinus2Throws() { var element = new DicomUnsignedShort(DicomTag.ReferencedFrameNumbers, 1, 2, 3, 4, 5); Assert.Throws <ArgumentOutOfRangeException>(() => element.Get <ushort>(-2)); }
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)); }
public void DicomUnsignedShortAsDicomElement_Array_GetObjectArrayValue() { DicomElement element = new DicomUnsignedShort(DicomTag.SynchronizationChannel, 5, 8); Assert.Equal(new object[] { (ushort)5, (ushort)8 }, element.Get <object[]>()); }