Esempio n. 1
0
    public async Task MisNamedQuery()
    {
        var queryString = @"
{
  misNamed
  {
    misNamedChildren
    {
      id
    }
  }
}";

        var entity1 = new WithMisNamedQueryParentEntity
        {
            Id = Guid.Parse("00000000-0000-0000-0000-000000000001")
        };
        var entity2 = new WithMisNamedQueryChildEntity
        {
            Id     = Guid.Parse("00000000-0000-0000-0000-000000000002"),
            Parent = entity1
        };
        var entity3 = new WithMisNamedQueryChildEntity
        {
            Id     = Guid.Parse("00000000-0000-0000-0000-000000000003"),
            Parent = entity1
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);
        var entity4 = new WithMisNamedQueryParentEntity
        {
            Id = Guid.Parse("00000000-0000-0000-0000-000000000004")
        };
        var entity5 = new WithMisNamedQueryChildEntity
        {
            Id     = Guid.Parse("00000000-0000-0000-0000-000000000005"),
            Parent = entity4
        };

        entity4.Children.Add(entity5);

        var result = await RunQuery(queryString, null, entity1, entity2, entity3, entity4, entity5);

        ObjectApprover.VerifyWithJson(result);
    }
Esempio n. 2
0
    public async Task MisNamedQuery()
    {
        var query = @"
{
  misNamed
  {
    misNamedChildren
    {
      id
    }
  }
}";

        var entity1 = new WithMisNamedQueryParentEntity();
        var entity2 = new WithMisNamedQueryChildEntity
        {
            Parent = entity1
        };
        var entity3 = new WithMisNamedQueryChildEntity
        {
            Parent = entity1
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);
        var entity4 = new WithMisNamedQueryParentEntity();
        var entity5 = new WithMisNamedQueryChildEntity
        {
            Parent = entity4
        };

        entity4.Children.Add(entity5);

        using (var database = await sqlInstance.Build())
        {
            var result = await RunQuery(database, query, null, null, entity1, entity2, entity3, entity4, entity5);

            ObjectApprover.Verify(result);
        }
    }
    public async Task MisNamedQuery()
    {
        var query = @"
{
  misNamed
  {
    misNamedChildren
    {
      id
    }
  }
}";

        var entity1 = new WithMisNamedQueryParentEntity();
        var entity2 = new WithMisNamedQueryChildEntity
        {
            Parent = entity1
        };
        var entity3 = new WithMisNamedQueryChildEntity
        {
            Parent = entity1
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);
        var entity4 = new WithMisNamedQueryParentEntity();
        var entity5 = new WithMisNamedQueryChildEntity
        {
            Parent = entity4
        };

        entity4.Children.Add(entity5);

        var result = await RunQuery(query, null, true, null, entity1, entity2, entity3, entity4, entity5);

        ObjectApprover.VerifyWithJson(result);
    }
Esempio n. 4
0
    public async Task MisNamedQuery()
    {
        var query = @"
{
  misNamed
  {
    misNamedChildren
    {
      id
    }
  }
}";

        var entity1 = new WithMisNamedQueryParentEntity();
        var entity2 = new WithMisNamedQueryChildEntity
        {
            Parent = entity1
        };
        var entity3 = new WithMisNamedQueryChildEntity
        {
            Parent = entity1
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);
        var entity4 = new WithMisNamedQueryParentEntity();
        var entity5 = new WithMisNamedQueryChildEntity
        {
            Parent = entity4
        };

        entity4.Children.Add(entity5);

        await using var database = await sqlInstance.Build();
        await RunQuery(database, query, null, null, false, new object[] { entity1, entity2, entity3, entity4, entity5 });
    }