public async Task QueryWithArguments(int?id, string itemSubType, int?price, int expected) { var queryArgs = $"id: {id}"; if (!(itemSubType is null)) { queryArgs += $", itemSubType: {itemSubType}"; } if (!(price is null)) { queryArgs += $", maximumPrice: {price}"; } var query = $@"query {{ products({queryArgs}) {{ sellerAgentAddress sellerAvatarAddress price itemUsable {{ itemId itemType itemSubType }} costume {{ itemId itemType itemSubType }} }} }}"; var queryResult = await ExecuteQueryAsync <ShopStateType>(query, source : Fixtures.ShopStateFX()); var products = queryResult.Data.As <Dictionary <string, object> >()["products"].As <List <object> >(); Assert.Equal(expected, products.Count); }