public async Task ItShouldReturnTimestampIfLedgerEntryFound() { await this.DatabaseTestAsync(async testDatabase => { this.target = new GetLatestCommittedLedgerDateDbStatement(testDatabase); await this.CreateDataAsync(testDatabase); await testDatabase.TakeSnapshotAsync(); var result = await this.target.ExecuteAsync(SubscriberId, CreatorId); Assert.AreEqual(Now.AddDays(1), result); return(ExpectedSideEffects.None); }); }
public async Task ItShouldReturnNullIfLedgerEntryNotFound() { await this.DatabaseTestAsync(async testDatabase => { this.target = new GetLatestCommittedLedgerDateDbStatement(testDatabase); await this.CreateDataAsync(testDatabase); await testDatabase.TakeSnapshotAsync(); var result = await this.target.ExecuteAsync(CreatorId, SubscriberId); Assert.IsNull(result); return(ExpectedSideEffects.None); }); }
public void Test() { this.target = new GetLatestCommittedLedgerDateDbStatement(new Mock <IFifthweekDbConnectionFactory>(MockBehavior.Strict).Object); }