コード例 #1
0
        /// <summary>
        ///  Method useful for asynchronously adding a MongoTestEntry object to MongoDB using the TestFixture's MongoWriterTask class.
        /// </summary>
        /// <remarks>This asynchronous implementation utilizes System.Threading.Tasks</remarks>
        protected Task AddMongoEntryAsyncTask(string message = "Hello World", string collectionName = MONGO_COLLECTION_1_NAME)
        {
            Entry mongoEntry = new Entry();

            mongoEntry.Message   = message;
            mongoEntry.TimeStamp = DateTime.Now;

            return(_asyncWriter.WriteAsync <Entry>(collectionName, mongoEntry));
        }
コード例 #2
0
        /// <summary>
        ///  Method useful for asynchronously adding a MongoTestEntry object to MongoDB using the TestFixture's MongoWriterAsync<T> class
        /// </summary>
        /// <remarks>Uses async System.Threading.Task</remarks>
        protected void AddMongoEntryAsyncTaskT(string message = "Hello World", string collectionName = MONGO_COLLECTION_1_NAME)
        {
            Entry mongoEntry = new Entry();

            mongoEntry.Message   = message;
            mongoEntry.TimeStamp = DateTime.Now;

            _asyncWriterT.WriteAsync(collectionName, mongoEntry);
        }
コード例 #3
0
 public Task WriteAsync <T>(string collectionName, T entry)
 {
     return(_asyncWriter.WriteAsync <T>(collectionName, entry));
 }