public void WhenInstanciatingDbQueryContextThenReturnsObject() { // Arrange FakeDbContext context = CreateDbContext(); // Act DbQueryContext<FakeDbContext> queryContext = new DbQueryContext<FakeDbContext>(context); // Assert Assert.NotNull(queryContext); }
public void WhenDisposingQueryContexthenDisposeInnerDbContext() { // Arrange FakeDbContext context = CreateDbContext(10); DbQueryContext<FakeDbContext> queryContext = new DbQueryContext<FakeDbContext>(context); // Act queryContext.Dispose(); // Assert Assert.True(context.Disposed); }
public async Task WhenFindingItemThenRetunsEntity() { // Arrange FakeDbContext context = CreateDbContext(10); DbQueryContext<FakeDbContext> queryContext = new DbQueryContext<FakeDbContext>(context); // Act FakeEntity result = await queryContext.FindAsync<FakeEntity>("test3"); // Assert Assert.NotNull(result); Assert.Equal(3, result.Property2); Assert.Equal("test3", result.Property1); }
public void WhenQueryingItemsThenReturnsEntities() { // Arrange FakeDbContext context = CreateDbContext(10); DbQueryContext<FakeDbContext> queryContext = new DbQueryContext<FakeDbContext>(context); // Act var query = queryContext.Query<FakeEntity>(); // Assert Assert.NotNull(query); Assert.Equal(context.Entities.Count(), query.Count()); Assert.NotNull(query.FirstOrDefault()); Assert.Equal(context.Entities.FirstOrDefault(), query.FirstOrDefault()); Assert.Equal(context.Entities.Count(item => item.Property2 >= 5), query.Count(item => item.Property2 >= 5)); }
internal MySQLGroupSortedResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
internal MySQLQuerySet(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
internal MySQLJoinGroupedResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
internal MySQLJoinFilterResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
protected override DbJoinGroupHavingResult <TEntity, TJoin1> CreateJoinGroupHavingResult <TEntity, TJoin1>(DbQueryContext queryContext) { return(new MySQLJoinGroupHavingResult <TEntity, TJoin1>(this, queryContext)); }
protected override DbJoinFilterResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4> CreateJoinFilterResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4>(DbQueryContext queryContext) { return(new MySQLJoinFilterResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4>(this, queryContext)); }
internal SQLServerQuerySet(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
protected override DbSortedQuerySet <TEntity> CreateSortedQuerySet <TEntity>(DbQueryContext queryContext) { return(new SQLServerSortedQuerySet <TEntity>(this, queryContext)); }
protected override DbJoinGroupHavingResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4> CreateJoinGroupHavingResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4>(DbQueryContext queryContext) { return(new SQLServerJoinGroupHavingResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4>(this, queryContext)); }
protected override DbJoinPagedResult <TEntity, TJoin1> CreateJoinPagedResult <TEntity, TJoin1>(DbQueryContext queryContext) { return(new SQLiteJoinPagedResult <TEntity, TJoin1>(this, queryContext)); }
protected override DbGroupHavingResult <TEntity> CreateGroupHavingResult <TEntity>(DbQueryContext queryContext) { return(new SQLiteGroupHavingResult <TEntity>(this, queryContext)); }
protected override DbQuerySet <TEntity> CreateQuerySet <TEntity>(DbQueryContext queryContext) { return(new SQLiteQuerySet <TEntity>(this, queryContext)); }
protected override DbJoinSortedResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4> CreateJoinSortedResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4>(DbQueryContext queryContext) { return(new SQLiteJoinSortedResult <TEntity, TJoin1, TJoin2, TJoin3, TJoin4>(this, queryContext)); }
protected override DbJoinedResult <TEntity, TJoin1, TJoin2> CreateJoinedResult <TEntity, TJoin1, TJoin2>(DbQueryContext queryContext) { return(new MySQLJoinedResult <TEntity, TJoin1, TJoin2>(this, queryContext)); }
internal SQLiteJoinGroupHavingResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
internal SQLServerGroupHavingResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
internal SQLServerJoinGroupSortedResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
internal SQLiteJoinedResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }
protected override DbJoinFilterResult <TEntity, TJoin1, TJoin2> CreateJoinFilterResult <TEntity, TJoin1, TJoin2>(DbQueryContext queryContext) { return(new SQLServerJoinFilterResult <TEntity, TJoin1, TJoin2>(this, queryContext)); }
protected override DbGroupSortedResult <TEntity> CreateGroupSortedResult <TEntity>(DbQueryContext queryContext) { return(new SQLServerGroupSortedResult <TEntity>(this, queryContext)); }
protected override DbGroupedResult <TEntity> CreateGroupedResult <TEntity>(DbQueryContext queryContext) { return(new MySQLGroupedResult <TEntity>(this, queryContext)); }
protected override DbJoinGroupSortedResult <TEntity, TJoin1> CreateJoinGroupSortedResult <TEntity, TJoin1>(DbQueryContext queryContext) { return(new SQLServerJoinGroupSortedResult <TEntity, TJoin1>(this, queryContext)); }
internal SQLServerJoinFilterResult(DbSession session, DbQueryContext queryContext) : base(session, queryContext) { }