public async Task WhenSubscriberHasNeverSubscribed_ItShouldReturnAllSubscriberCreators() { await this.DatabaseTestAsync(async testDatabase => { this.target = new GetCreatorsAndFirstSubscribedDatesDbStatement(testDatabase); await testDatabase.TakeSnapshotAsync(); var result = await this.target.ExecuteAsync(SubscriberId); Assert.AreEqual(0, result.Count); return(ExpectedSideEffects.None); }); }
public async Task ItShouldReturnAllSubscriberCreatorsWithFirstSubscribedDates() { await this.DatabaseTestAsync(async testDatabase => { this.target = new GetCreatorsAndFirstSubscribedDatesDbStatement(testDatabase); await this.CreateDataAsync(testDatabase); await testDatabase.TakeSnapshotAsync(); var result = await this.target.ExecuteAsync(SubscriberId); Assert.AreEqual(2, result.Count); Assert.IsTrue(result.Contains(new CreatorIdAndFirstSubscribedDate(CreatorId1, Now.AddDays(-1)))); Assert.IsTrue(result.Contains(new CreatorIdAndFirstSubscribedDate(CreatorId2, Now.AddDays(1)))); return(ExpectedSideEffects.None); }); }
public void Test() { this.target = new GetCreatorsAndFirstSubscribedDatesDbStatement(new Mock <IFifthweekDbConnectionFactory>(MockBehavior.Strict).Object); }