Exemple #1
0
    public async Task Skip_level()
    {
        var queryString = @"
{
  skipLevel
  {
    level3Entity
    {
      property
    }
  }
}";

        var level3 = new Level3Entity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000003"),
            Property = "Value"
        };
        var level2 = new Level2Entity
        {
            Id           = Guid.Parse("00000000-0000-0000-0000-000000000002"),
            Level3Entity = level3
        };
        var level1 = new Level1Entity
        {
            Id           = Guid.Parse("00000000-0000-0000-0000-000000000001"),
            Level2Entity = level2
        };

        var result = await RunQuery(queryString, null, level1, level2, level3);

        ObjectApprover.VerifyWithJson(result);
    }
Exemple #2
0
    public async Task Multiple_nested()
    {
        var query = @"
{
  level1Entities
  {
    level2Entity
    {
      level3Entity
      {
        property
      }
    }
  }
}";

        var level3 = new Level3Entity
        {
            Property = "Value"
        };
        var level2 = new Level2Entity
        {
            Level3Entity = level3
        };
        var level1 = new Level1Entity
        {
            Level2Entity = level2
        };

        await using var database = await sqlInstance.Build();
        await RunQuery(database, query, null, null, false, new object[] { level1, level2, level3 });
    }
Exemple #3
0
    public async Task Skip_level()
    {
        var query = @"
{
  skipLevel
  {
    level3Entity
    {
      property
    }
  }
}";

        var level3 = new Level3Entity
        {
            Property = "Value"
        };
        var level2 = new Level2Entity
        {
            Level3Entity = level3
        };
        var level1 = new Level1Entity
        {
            Level2Entity = level2
        };

        var database = await sqlInstance.Build();

        var result = await RunQuery(database, query, null, null, level1, level2, level3);

        ObjectApprover.Verify(result);
    }
Exemple #4
0
    public async Task Skip_level()
    {
        var query = @"
{
  skipLevel
  {
    level3Entity
    {
      property
    }
  }
}";

        var level3 = new Level3Entity
        {
            Property = "Value"
        };
        var level2 = new Level2Entity
        {
            Level3Entity = level3
        };
        var level1 = new Level1Entity
        {
            Level2Entity = level2
        };

        var database = await sqlInstance.Build();

        await RunQuery(database, query, null, null, false, new object[] { level1, level2, level3 });
    }
Exemple #5
0
    public async Task Multiple_nested()
    {
        var query = @"
{
  level1Entities
  {
    level2Entity
    {
      level3Entity
      {
        property
      }
    }
  }
}";

        var level3 = new Level3Entity
        {
            Property = "Value"
        };
        var level2 = new Level2Entity
        {
            Level3Entity = level3
        };
        var level1 = new Level1Entity
        {
            Level2Entity = level2
        };

        await using var database = await sqlInstance.Build();

        var result = await RunQuery(database, query, null, null, level1, level2, level3);

        await Verifier.Verify(result);
    }
    public async Task Multiple_nested()
    {
        var query = @"
{
  level1Entities
  {
    level2Entity
    {
      level3Entity
      {
        property
      }
    }
  }
}";

        var level3 = new Level3Entity
        {
            Property = "Value"
        };
        var level2 = new Level2Entity
        {
            Level3Entity = level3
        };
        var level1 = new Level1Entity
        {
            Level2Entity = level2
        };

        var result = await RunQuery(query, null, true, null, level1, level2, level3);

        ObjectApprover.VerifyWithJson(result);
    }
Exemple #7
0
    public async Task Null_on_nested()
    {
        var queryString = @"
{
  level1Entities(where: {path: 'Level2Entity.Level3EntityId', comparison: 'equal', value: '00000000-0000-0000-0000-000000000003'})
  {
    level2Entity
    {
      level3Entity
      {
        property
      }
    }
  }
}";

        var level3a = new Level3Entity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000003"),
            Property = "Valuea"
        };
        var level2a = new Level2Entity
        {
            Id           = Guid.Parse("00000000-0000-0000-0000-000000000002"),
            Level3Entity = level3a
        };
        var level1a = new Level1Entity
        {
            Id           = Guid.Parse("00000000-0000-0000-0000-000000000001"),
            Level2Entity = level2a
        };

        var level2b = new Level2Entity
        {
            Id = Guid.Parse("00000000-0000-0000-0000-000000000004"),
        };
        var level1b = new Level1Entity
        {
            Id           = Guid.Parse("00000000-0000-0000-0000-000000000005"),
            Level2Entity = level2b
        };

        var result = await RunQuery(queryString, null, level1b, level2b, level1a, level2a, level3a);

        ObjectApprover.VerifyWithJson(result);
    }
Exemple #8
0
    public async Task Null_on_nested()
    {
        var query = @"
{
  level1Entities(where: {path: 'Level2Entity.Level3EntityId', comparison: 'equal', value: '00000000-0000-0000-0000-000000000003'})
  {
    level2Entity
    {
      level3Entity
      {
        property
      }
    }
  }
}";

        var level3a = new Level3Entity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000003"),
            Property = "Valuea"
        };
        var level2a = new Level2Entity
        {
            Level3Entity = level3a
        };
        var level1a = new Level1Entity
        {
            Level2Entity = level2a
        };

        var level2b = new Level2Entity();
        var level1b = new Level1Entity
        {
            Level2Entity = level2b
        };

        using (var database = await sqlInstance.Build())
        {
            var result = await RunQuery(database, query, null, null, level1b, level2b, level1a, level2a, level3a);

            ObjectApprover.Verify(result);
        }
    }
Exemple #9
0
    public async Task Null_on_nested()
    {
        var query = @"
{
  level1Entities(where: {path: 'Level2Entity.Level3EntityId', comparison: equal, value: '00000000-0000-0000-0000-000000000003'})
  {
    level2Entity
    {
      level3Entity
      {
        property
      }
    }
  }
}";

        var level3a = new Level3Entity
        {
            Id       = Guid.Parse("00000000-0000-0000-0000-000000000003"),
            Property = "Valuea"
        };
        var level2a = new Level2Entity
        {
            Level3Entity = level3a
        };
        var level1a = new Level1Entity
        {
            Level2Entity = level2a
        };

        var level2b = new Level2Entity();
        var level1b = new Level1Entity
        {
            Level2Entity = level2b
        };

        await using var database = await sqlInstance.Build();
        await RunQuery(database, query, null, null, false, new object[] { level1b, level2b, level1a, level2a, level3a });
    }