Exemplo n.º 1
0
        public void SaveComplexData()
        {
            MonCFExampleDataStore dataStore = new MonCFExampleDataStore("mongodb://localhost");

            Guid theID = Guid.NewGuid();

            var complexData = TestUtils.GetRandomComplexData();
            complexData.Id = theID;

            dataStore.SaveComplexData(complexData);

            var dataBack = dataStore.GetComplexData(theID);

            Assert.Equal(complexData, dataBack);
        }
Exemplo n.º 2
0
        public void SaveComplexSet()
        {
            MonCFExampleDataStore dataStore = new MonCFExampleDataStore("mongodb://localhost");

            List<ComplexData> cds = new List<ComplexData>();

            for (int i = 0; i < 100; i++)
            {
                var complexData = TestUtils.GetRandomComplexData();

                cds.Add(complexData);
            }

            dataStore.SaveComplexDataSet(cds);

            foreach (var cd in cds)
            {
                var retcd = dataStore.GetComplexData(cd.Id);

                Assert.Equal(cd, retcd);
            }
        }