Ejemplo n.º 1
0
    public async Task Child_filtered()
    {
        var query = @"
{
  parentEntitiesFiltered
  {
    property
    children
    {
      property
    }
  }
}";

        var entity1 = new FilterParentEntity
        {
            Property = "Value1"
        };
        var entity2 = new FilterChildEntity
        {
            Property = "Ignore",
            Parent   = entity1
        };
        var entity3 = new FilterChildEntity
        {
            Property = "Value3",
            Parent   = entity1
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);
        var result = await RunQuery(query, null, true, BuildFilters(), entity1, entity2, entity3);

        ObjectApprover.VerifyWithJson(result);
    }
Ejemplo n.º 2
0
    public async Task Child_filtered()
    {
        var query = @"
{
  parentEntitiesFiltered
  {
    property
    children
    {
      property
    }
  }
}";

        var entity1 = new FilterParentEntity
        {
            Property = "Value1"
        };
        var entity2 = new FilterChildEntity
        {
            Property = "Ignore",
            Parent   = entity1
        };
        var entity3 = new FilterChildEntity
        {
            Property = "Value3",
            Parent   = entity1
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);
        await using var database = await sqlInstance.Build();
        await RunQuery(database, query, null, BuildFilters(), false, new object[] { entity1, entity2, entity3 });
    }
Ejemplo n.º 3
0
    public async Task Connection_parent_child_Filtered()
    {
        var queryString = @"
{
  parentEntitiesConnectionFiltered {
    totalCount
    edges {
      cursor
      node {
        property
        children
        {
          property
        }
      }
    }
    items {
      property
      children
      {
        property
      }
    }
  }
}
";
        var entity1     = new FilterParentEntity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000001"),
            Property = "Value1"
        };
        var entity2 = new FilterChildEntity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000002"),
            Property = "Ignore"
        };
        var entity3 = new FilterChildEntity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000003"),
            Property = "Value3"
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);

        var result = await RunQuery(queryString, null, true, BuildFilters(), entity1, entity2, entity3);

        ObjectApprover.VerifyWithJson(result);
    }
    public async Task Connection_parent_child_Filtered()
    {
        var query   = @"
{
  parentEntitiesConnectionFiltered {
    totalCount
    edges {
      cursor
      node {
        property
        children
        {
          property
        }
      }
    }
    items {
      property
      children
      {
        property
      }
    }
  }
}
";
        var entity1 = new FilterParentEntity
        {
            Property = "Value1"
        };
        var entity2 = new FilterChildEntity
        {
            Property = "Ignore"
        };
        var entity3 = new FilterChildEntity
        {
            Property = "Value3"
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);

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

            ObjectApprover.VerifyWithJson(result);
        }
    }
Ejemplo n.º 5
0
    public async Task Connection_parent_child_Filtered()
    {
        var query   = @"
{
  parentEntitiesConnectionFiltered {
    totalCount
    edges {
      cursor
      node {
        property
        children
        {
          property
        }
      }
    }
    items {
      property
      children
      {
        property
      }
    }
  }
}
";
        var entity1 = new FilterParentEntity
        {
            Property = "Value1"
        };
        var entity2 = new FilterChildEntity
        {
            Property = "Ignore"
        };
        var entity3 = new FilterChildEntity
        {
            Property = "Value3"
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);

        await using var database = await sqlInstance.Build();
        await RunQuery(database, query, null, BuildFilters(), false, new object[] { entity1, entity2, entity3 });
    }
    public async Task Child_filtered()
    {
        var query = @"
{
  parentEntitiesFiltered
  {
    property
    children
    {
      property
    }
  }
}";

        var entity1 = new FilterParentEntity
        {
            Property = "Value1"
        };
        var entity2 = new FilterChildEntity
        {
            Property = "Ignore",
            Parent   = entity1
        };
        var entity3 = new FilterChildEntity
        {
            Property = "Value3",
            Parent   = entity1
        };

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

            ObjectApprover.Verify(result);
        }
    }
    public async Task Child_filtered()
    {
        var queryString = @"
{
  parentEntitiesFiltered
  {
    property
    children
    {
      property
    }
  }
}";

        var entity1 = new FilterParentEntity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000001"),
            Property = "Value1"
        };
        var entity2 = new FilterChildEntity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000002"),
            Property = "Ignore",
            Parent   = entity1
        };
        var entity3 = new FilterChildEntity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000003"),
            Property = "Value3",
            Parent   = entity1
        };

        entity1.Children.Add(entity2);
        entity1.Children.Add(entity3);
        var result = await RunQuery(queryString, null, entity1, entity2, entity3);

        ObjectApprover.VerifyWithJson(result);
    }