Example #1
0
    public void Item_prices_can_be_created_from_json() =>
    AssertEx.ForEach(
        fixture.ItemPrices,
        json =>
    {
        using var document = JsonDocument.Parse(json);

        var actual = document.RootElement.GetItemPrice(MissingMemberBehavior.Error);

        ItemPriceFact.Id_is_positive(actual);
        ItemPriceFact.Best_ask_is_greater_than_best_bid(actual);
    }
        );
Example #2
0
        public void Item_prices_can_be_created_from_json()
        {
            var settings = new JsonSerializerSettingsBuilder().UseTraceWriter(new XunitTraceWriter(_output))
                           .UseMissingMemberHandling(MissingMemberHandling.Error)
                           .Build();

            AssertEx.ForEach(_fixture.Db.ItemPrices,
                             json =>
            {
                var actual = JsonConvert.DeserializeObject <ItemPrice>(json, settings);

                ItemPriceFact.Id_is_positive(actual);
            });
        }