Ejemplo n.º 1
0
    public async Task Calls_Db_QueryAsync()
    {
        // Arrange
        var(db, w, v) = Setup();

        // Act
        await QueryTermsF.ExecuteAsync <Test>(db, w, opt => opt);

        // Assert
        await db.Query.Received().QueryAsync <Test>(Arg.Any <IQueryParts>(), v.Transaction);
    }
Ejemplo n.º 2
0
    public async Task Catches_Opt_Exception_Returns_None_With_ErrorGettingQueryAttachmentsOptionsMsg()
    {
        // Arrange
        var(db, w, _) = Setup();

        // Act
        var result = await QueryTermsF.ExecuteAsync <Test>(db, w, _ => throw new Exception());

        // Assert
        result.AssertNone().AssertType <ErrorGettingQueryTermsOptionsMsg>();
    }
Ejemplo n.º 3
0
 /// <inheritdoc/>
 public async Task <Maybe <IEnumerable <T> > > TermsAsync <T>(Query.GetTermsOptions opt)
     where T : IWithId <WpTermId>
 {
     using var w = Db.UnitOfWork;
     return(await QueryTermsF.ExecuteAsync <T>(Db, w, opt).ConfigureAwait(false));
 }
Ejemplo n.º 4
0
 /// <inheritdoc/>
 public Task <Maybe <IEnumerable <T> > > ExecuteAsync <T>(IWpDb db, IUnitOfWork w, GetTermsOptions opt)
     where T : IWithId <WpTermId> =>
 QueryTermsF.ExecuteAsync <T>(db, w, opt);