public async Task ItShouldReturnZeroTotalRevenueForUnknownUser() { await this.DatabaseTestAsync(async testDatabase => { this.target = new GetCreatorRevenueDbStatement(testDatabase); await this.CreateDataAsync(testDatabase); await testDatabase.TakeSnapshotAsync(); var result = await this.target.ExecuteAsync(UserId.Random(), Now.AddDays(5)); Assert.AreEqual(new GetCreatorRevenueDbStatement.GetCreatorRevenueDbStatementResult( 0, 0, 0), result); return(ExpectedSideEffects.None); }); }
private void InitializeServices(TestDatabaseContext testDatabase) { this.updateAccountBalances = new UpdateAccountBalancesDbStatement(testDatabase); this.getAccountSettings = new GetAccountSettingsDbStatement(testDatabase); this.getCreatorRevenue = new GetCreatorRevenueDbStatement(testDatabase); this.persistCreditRefund = new PersistCreditRefund( new GuidCreator(), new PersistCommittedRecordsDbStatement(testDatabase)); this.createTransactionRefund = new CreateTransactionRefund( new GuidCreator(), new GetRecordsForTransactionDbStatement(testDatabase), new PersistCommittedRecordsDbStatement(testDatabase)); this.getCreditTransactionInformation = new GetCreditTransactionInformation( new GetRecordsForTransactionDbStatement(testDatabase)); this.getCalculatedAccountBalances = new GetCalculatedAccountBalancesDbStatement(testDatabase); }
public void Initialize() { this.target = new GetCreatorRevenueDbStatement(new Mock <IFifthweekDbConnectionFactory>(MockBehavior.Strict).Object); }