예제 #1
0
        public async Task TearDown()
        {
            config = new SyncConfiguration("myPartition", user);
            await plantsCollection.DeleteManyAsync();

            return;
        }
예제 #2
0
        public async Task TearDown()
        {
            config          = new SyncConfiguration("myPartition", user);
            using var realm = await Realm.GetInstanceAsync(config);

            {
                var filter       = new BsonDocument("name", "Thai Basil");
                var deleteResult = await plantsCollection.DeleteOneAsync(filter);
            }
            {
                var filter       = new BsonDocument("type", PlantType.Annual);
                var deleteResult = await plantsCollection.DeleteManyAsync(filter);
            }
            await plantsCollection.DeleteManyAsync();

            return;
        }
예제 #3
0
        public async Task TearDown()
        {
            using var realm = await Realm.GetInstanceAsync(config);

            {
                // :code-block-start: mongo-delete-one
                var filter       = new BsonDocument("name", "Thai Basil");
                var deleteResult = await plantsCollection.DeleteOneAsync(filter);

                // :code-block-end:
            }
            {
                // :code-block-start: mongo-delete-many
                var filter       = new BsonDocument("type", PlantType.Annual);
                var deleteResult = await plantsCollection.DeleteManyAsync(filter);

                // :code-block-end:
            }
            await plantsCollection.DeleteManyAsync();

            return;
        }
예제 #4
0
        public async Task TearDown()
        {
            // :code-block-start: mongo-delete-one
            var filter       = new BsonDocument("name", "Thai Basil");
            var deleteResult = await plantsCollection.DeleteOneAsync(filter);

            // :code-block-end:

            // :code-block-start: mongo-delete-many
            // :replace-start: {
            //  "terms": {
            //   "filter2": "filter",
            //   "deleteResult2": "deleteResult" }
            // }
            var filter2       = new BsonDocument("type", PlantType.Annual);
            var deleteResult2 = await plantsCollection.DeleteManyAsync(filter);

            // :replace-end:
            // :code-block-end:

            await plantsCollection.DeleteManyAsync();

            return;
        }
예제 #5
0
        public async Task TearDown()
        {
            await plantsCollection.DeleteManyAsync();

            return;
        }
예제 #6
0
        public async Task Setup()
        {
            app    = App.Create(myRealmAppId);
            user   = app.LogInAsync(Credentials.EmailPassword("*****@*****.**", "foobar")).Result;
            config = new PartitionSyncConfiguration("myPart", user);
            //:hide-start:
            config.Schema = new[] { typeof(Plant) };
            //:hide-end:
            SetupPlantCollection();

            await plantsCollection.DeleteManyAsync();

            venus = new Plant
            {
                Name      = "Venus Flytrap",
                Sunlight  = Sunlight.Full.ToString(),
                Color     = PlantColor.White.ToString(),
                Type      = PlantType.Perennial.ToString(),
                Partition = "Store 42"
            };
            sweetBasil = new Plant
            {
                Name      = "Sweet Basil",
                Sunlight  = Sunlight.Partial.ToString(),
                Color     = PlantColor.Green.ToString(),
                Type      = PlantType.Annual.ToString(),
                Partition = "Store 42"
            };
            thaiBasil = new Plant
            {
                Name      = "Thai Basil",
                Sunlight  = Sunlight.Partial.ToString(),
                Color     = PlantColor.Green.ToString(),
                Type      = PlantType.Perennial.ToString(),
                Partition = "Store 42"
            };
            helianthus = new Plant
            {
                Name      = "Helianthus",
                Sunlight  = Sunlight.Full.ToString(),
                Color     = PlantColor.Yellow.ToString(),
                Type      = PlantType.Annual.ToString(),
                Partition = "Store 42"
            };
            petunia = new Plant
            {
                Name      = "Petunia",
                Sunlight  = Sunlight.Full.ToString(),
                Color     = PlantColor.Purple.ToString(),
                Type      = PlantType.Annual.ToString(),
                Partition = "Store 47"
            };

            var listofPlants = new List <Plant>
            {
                venus,
                sweetBasil,
                thaiBasil,
                helianthus,
                petunia
            };

            var insertResult = await plantsCollection.InsertManyAsync(listofPlants);



            return;
        }
 public async Task TearDown()
 {
     await cudCollection.DeleteManyAsync();
 }