public void BsonRoundTrip_NormalPrivateDataset_SameAfterConversion()
        {
            DicomDataset ds = TranslationTestHelpers.BuildPrivateDataset();

            ds = new DicomDataset(ds.Where(x => !DicomTypeTranslater.DicomVrBlacklist.Contains(x.ValueRepresentation)));
            VerifyBsonTripleTrip(ds);
        }
        public void Deserialize_PrivateCreators_AreSet()
        {
            DicomDataset originalDataset = TranslationTestHelpers.BuildPrivateDataset();

            ValidatePrivateCreatorsExist(originalDataset);

            string json   = JsonConvert.SerializeObject(originalDataset, new JsonDicomConverter());
            var    recoDs = JsonConvert.DeserializeObject <DicomDataset>(json, new JsonDicomConverter());

            ValidatePrivateCreatorsExist(recoDs);
        }
        public void BsonRoundTrip_BlacklistPrivateDataset_ZeroAfterConversion()
        {
            DicomDataset ds = TranslationTestHelpers.BuildPrivateDataset();

            ds = new DicomDataset(ds.Where(x => DicomTypeTranslater.DicomVrBlacklist.Contains(x.ValueRepresentation)));
            BsonDocument doc         = DicomTypeTranslaterReader.BuildBsonDocument(ds);
            DicomDataset recoDataset = DicomTypeTranslaterWriter.BuildDicomDataset(doc);
            BsonDocument recoDoc     = DicomTypeTranslaterReader.BuildBsonDocument(recoDataset);

            Assert.AreEqual(doc, recoDoc);

            foreach (DicomElement element in recoDataset.Select(x => (DicomElement)x))
            {
                Assert.Zero(element.Buffer.Size);
            }
        }
        public void DicomToBson_TranslatePrivateDataset_DoesNotThrow()
        {
            DicomDataset ds = TranslationTestHelpers.BuildPrivateDataset();

            Assert.DoesNotThrow(() => DicomTypeTranslaterReader.BuildBsonDocument(ds));
        }