public void Dispose_SetsFetchedAtValueToNull_IfThereWereNoCallsToComplete() { UseConnection(connection => { // Arrange var id = CreateJobQueueRecord(connection, "1", "default"); var processingJob = new MongoFetchedJob(connection, id, "1", "default"); // Act processingJob.Dispose(); // Assert var record = connection.JobQueue.Find(new BsonDocument()).ToList().Single(); Assert.Null(record.FetchedAt); }); }
public void Dispose_SetsFetchedAtValueToNull_IfThereWereNoCallsToComplete() { // Arrange var queue = "default"; var jobId = ObjectId.GenerateNewId(); var id = CreateJobQueueRecord(_dbContext, jobId, queue); var processingJob = new MongoFetchedJob(_dbContext, id, jobId, queue); // Act processingJob.Dispose(); // Assert var record = _dbContext.JobGraph.OfType <JobQueueDto>().Find(new BsonDocument()).ToList().Single(); Assert.Null(record.FetchedAt); }
public void Dispose_SetsFetchedAtValueToNull_IfThereWereNoCallsToComplete() { UseConnection(sql => { // Arrange var id = CreateJobQueueRecord(sql, "1", "default"); var processingJob = new MongoFetchedJob(sql, id, "1", "default"); // Act processingJob.Dispose(); // Assert var record = sql.JobQueue.FindAll().Single(); Assert.Null(record.FetchedAt); }); }
public void Dispose_SetsFetchedAtValueToNull_IfThereWereNoCallsToComplete() { ConnectionUtils.UseConnection(database => { // Arrange var queue = "default"; var jobId = ObjectId.GenerateNewId(); var id = CreateJobQueueRecord(database, jobId, queue); var processingJob = new MongoFetchedJob(database, id, jobId, queue); // Act processingJob.Dispose(); // Assert var record = database.JobQueue.Find(new BsonDocument()).ToList().Single(); Assert.Null(record.FetchedAt); }); }
public void Dispose_SetsFetchedAtValueToNull_IfThereWereNoCallsToComplete() { UseConnection(connection => { // Arrange var id = CreateJobQueueRecord(connection, "1", "default"); var processingJob = new MongoFetchedJob(connection, id, "1", "default"); // Act processingJob.Dispose(); // Assert var record = AsyncHelper.RunSync(() => connection.JobQueue.Find(new BsonDocument()).ToListAsync()).Single(); Assert.Null(record.FetchedAt); }); }