public void OnDeserialized_entities()
        {
            MockEntity entity1 = new MockEntity()
            {
                id = 1
            };
            MockEntity entity2 = new MockEntity()
            {
                id = 2
            };
            DbEntityDataBundle dataBundle = new DbEntityDataBundle();

            dataBundle.Type = typeof(MockEntity);
            dataBundle.AddParameter(DbEntityDataBundle.EntitiesJsonParameterKey, "[{\"$id\":\"" + entity1.Guid + "\",\"id\":" + entity1.id + "},{\"$id\":\"" + entity2.Guid + "\",\"id\":" + entity2.id + "}]");

            dataBundle.OnDeserialized(default(StreamingContext));

            Assert.AreEqual(1, dataBundle.Parameters.Count);
            Assert.IsTrue(dataBundle.Contains <List <MockEntity> >(DbEntityDataBundle.EntitiesParameterKey));
            Assert.IsFalse(dataBundle.Contains <string>(DbEntityDataBundle.EntitiesJsonParameterKey));
            Assert.IsFalse(dataBundle.Contains <MockEntity>(DbEntityDataBundle.EntityParameterKey));
            Assert.IsFalse(dataBundle.Contains <string>(DbEntityDataBundle.EntityJsonParameterKey));
            Assert.AreEqual(2, dataBundle.GetParameter <List <MockEntity> >(DbEntityDataBundle.EntitiesParameterKey).Count());
            Assert.IsTrue(dataBundle.GetParameter <List <MockEntity> >(DbEntityDataBundle.EntitiesParameterKey).Any(j => j.id == entity1.id));
            Assert.IsTrue(dataBundle.GetParameter <List <MockEntity> >(DbEntityDataBundle.EntitiesParameterKey).Any(j => j.id == entity2.id));
        }
        public void OnDeserialized_entities_empty()
        {
            DbEntityDataBundle dataBundle = new DbEntityDataBundle();

            dataBundle.Type = typeof(MockEntity);
            dataBundle.AddParameter(DbEntityDataBundle.EntitiesJsonParameterKey, "[]");

            dataBundle.OnDeserialized(default(StreamingContext));

            Assert.AreEqual(1, dataBundle.Parameters.Count);
            Assert.IsTrue(dataBundle.Contains <List <MockEntity> >(DbEntityDataBundle.EntitiesParameterKey));
            Assert.IsFalse(dataBundle.Contains <string>(DbEntityDataBundle.EntitiesJsonParameterKey));
            Assert.IsFalse(dataBundle.Contains <MockEntity>(DbEntityDataBundle.EntityParameterKey));
            Assert.IsFalse(dataBundle.Contains <string>(DbEntityDataBundle.EntityJsonParameterKey));
            Assert.AreEqual(0, dataBundle.GetParameter <List <MockEntity> >(DbEntityDataBundle.EntitiesParameterKey).Count());
        }