public void HasValidHeader_False() { var filename = Path.GetTempFileName(); using (var writer = new StreamWriter(filename)) { writer.WriteLine("Hello World!"); } var dicomToolkit = new DicomToolkit(); Assert.False(dicomToolkit.HasValidHeader(filename)); }
public void HasValidHeader_True() { var filename = Path.GetTempFileName(); var dicomFile = new DicomFile(); dicomFile.Dataset.Add(DicomTag.SOPInstanceUID, DicomUIDGenerator.GenerateDerivedFromUUID()); dicomFile.FileMetaInfo.TransferSyntax = DicomTransferSyntax.ExplicitVRLittleEndian; dicomFile.FileMetaInfo.MediaStorageSOPInstanceUID = DicomUIDGenerator.GenerateDerivedFromUUID(); dicomFile.FileMetaInfo.MediaStorageSOPClassUID = DicomUIDGenerator.GenerateDerivedFromUUID(); dicomFile.Save(filename); var dicomToolkit = new DicomToolkit(); Assert.True(dicomToolkit.HasValidHeader(filename)); }