public void BsonRoundTrip_BlacklistedVrs_ConvertedCorrectly() { var ds = new DicomDataset { new DicomOtherByte(DicomTag.SelectorOBValue, byte.MinValue), new DicomOtherWord(DicomTag.SelectorOWValue, byte.MinValue), new DicomUnknown(DicomTag.SelectorUNValue, byte.MinValue) }; // Ensure this test fails if we update the blacklist later Assert.True( ds.Select(x => x.ValueRepresentation).All(DicomTypeTranslater.DicomVrBlacklist.Contains) && ds.Count() == DicomTypeTranslater.DicomVrBlacklist.Length); BsonDocument doc = DicomTypeTranslaterReader.BuildBsonDocument(ds); Assert.NotNull(doc); Assert.True(doc.All(x => x.Value.IsBsonNull)); DicomDataset recoDs = DicomTypeTranslaterWriter.BuildDicomDataset(doc); Assert.AreEqual(3, recoDs.Count()); foreach (DicomItem item in recoDs) { Assert.Zero(((DicomElement)item).Count); } }
// private methods private bool CanRunOn(BsonDocument requirements) { return(requirements.All(IsRequirementSatisfied)); }