chromium/third_party/libaddressinput/src/cpp/test/localization_test.cc

// Copyright (C) 2013 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <libaddressinput/localization.h>

#include <libaddressinput/address_data.h>
#include <libaddressinput/address_field.h>
#include <libaddressinput/address_problem.h>

#include <string>
#include <vector>

#include <gtest/gtest.h>

#include "grit.h"
#include "messages.h"

namespace {

AddressData;
AddressField;
INVALID_MESSAGE_ID;
Localization;

COUNTRY;
ADMIN_AREA;
LOCALITY;
DEPENDENT_LOCALITY;
SORTING_CODE;
POSTAL_CODE;
STREET_ADDRESS;
ORGANIZATION;
RECIPIENT;

MISSING_REQUIRED_FIELD;
UNKNOWN_VALUE;
INVALID_FORMAT;
MISMATCHING_VALUE;
USES_P_O_BOX;

// Tests for Localization object.
class LocalizationTest : public testing::TestWithParam<int> {};

// Verifies that a custom message getter can be used.
const char kValidMessage[] =;
std::string GetValidMessage(int message_id) {}
TEST_P(LocalizationTest, ValidStringGetterCanBeUsed) {}

// Verifies that the default language for messages does not have empty strings.
TEST_P(LocalizationTest, DefaultStringIsNotEmpty) {}

// Verifies that the messages do not have newlines.
TEST_P(LocalizationTest, NoNewline) {}

// Verifies that the messages do not have double spaces.
TEST_P(LocalizationTest, NoDoubleSpace) {}

// Tests all message identifiers.
INSTANTIATE_TEST_SUITE_P();

// Verifies that an invalid message identifier results in an empty string in the
// default configuration.
TEST_F(LocalizationTest, InvalidMessageIsEmptyString) {}

TEST(LocalizationGetErrorMessageTest, MissingRequiredPostalCode) {}

TEST(LocalizationGetErrorMessageTest, MissingRequiredZipCode) {}

TEST(LocalizationGetErrorMessageTest, MissingRequiredOtherFields) {}

TEST(LocalizationGetErrorMessageTest, UnknownValueOtherFields) {}

TEST(LocalizationGetErrorMessageTest, InvalidFormatPostalCode) {}

TEST(LocalizationGetErrorMessageTest, InvalidFormatZipCode) {}

TEST(LocalizationGetErrorMessageTest, MismatchingValuePostalCode) {}

TEST(LocalizationGetErrorMessageTest, MismatchingValueZipCode) {}

TEST(LocalizationGetErrorMessageTest, UsesPOBoxOtherFields) {}

}  // namespace