#include "tools/json_schema_compiler/test/ignore_additional_properties.h"
#include <memory>
#include <utility>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
namespace iap = test::api::ignore_additional_properties;
TEST(…) {
{
base::Value::List list_value;
list_value.Append("asdf");
list_value.Append(4);
base::Value::Dict type_value;
type_value.Set("string", "value");
type_value.Set("other", 9);
type_value.Set("another", std::move(list_value));
auto type = iap::IgnoreAdditionalPropertiesType::FromValue(type_value);
ASSERT_TRUE(…);
EXPECT_EQ(…);
}
{
base::Value::Dict type_value;
type_value.Set("string", "value");
auto type = iap::IgnoreAdditionalPropertiesType::FromValue(type_value);
ASSERT_TRUE(…);
EXPECT_EQ(…);
}
{
base::Value::Dict type_value;
type_value.Set("other", 9);
auto type = iap::IgnoreAdditionalPropertiesType::FromValue(type_value);
ASSERT_FALSE(…);
}
{
base::Value::Dict type_dict;
type_dict.Set("string", 3);
auto type = iap::IgnoreAdditionalPropertiesType::FromValue(type_dict);
EXPECT_FALSE(…);
}
}
TEST(…) {
base::Value::Dict param_object_dict;
param_object_dict.Set("str", "a");
param_object_dict.Set("num", 1);
base::Value param_object_value(std::move(param_object_dict));
base::Value::List params_value;
params_value.Append(param_object_value.Clone());
auto params(
iap::IgnoreAdditionalPropertiesParams::Params::Create(params_value));
EXPECT_TRUE(…);
}