예제 #1
0
        public void RunTest(BsonDocument data, BsonDocument testDefinition)
        {
            var test = GridFSTestFactory.CreateTest(data, testDefinition);

            string reason;

            if (!test.CanRun(out reason))
            {
                throw new SkipException(reason);
            }

            var client   = DriverTestConfiguration.Client;
            var database = client.GetDatabase(DriverTestConfiguration.DatabaseNamespace.DatabaseName);
            var bucket   = new GridFSBucket(database);

            test.Run(bucket, async: false);
            test.Run(bucket, async: true);
        }
        public async Task RunTestAsync(BsonDocument data, BsonDocument testDefinition)
        {
            var test = GridFSTestFactory.CreateTest(data, testDefinition);

            string reason;

            if (!test.CanRun(out reason))
            {
                Assert.Ignore(reason);
                return;
            }

            var client   = DriverTestConfiguration.Client;
            var database = client.GetDatabase(DriverTestConfiguration.DatabaseNamespace.DatabaseName);
            var bucket   = new GridFSBucket(database);

            await test.RunAsync(bucket);
        }