예제 #1
0
        public void Colors_can_be_created_from_json()
        {
            var settings = new JsonSerializerSettingsBuilder()
                           .UseTraceWriter(new XunitTraceWriter(_output))
                           .UseMissingMemberHandling(MissingMemberHandling.Error)
                           .Build();

            AssertEx.ForEach(_fixture.Db.Colors,
                             json =>
            {
                var actual = JsonConvert.DeserializeObject <Color>(json, settings);
                ColorFact.Base_rgb_contains_red_green_blue(actual);
            });
        }
예제 #2
0
    public async Task Colors_can_be_enumerated()
    {
        await using Composer services = new();
        var sut = services.Resolve <Gw2Client>();

        var actual = await sut.Dyes.GetColors();

        Assert.Equal(actual.Context.ResultTotal, actual.Count);
        Assert.All(
            actual,
            color =>
        {
            ColorFact.Base_rgb_contains_red_green_blue(color);
        }
            );
    }