Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: components/payments/currency_formatter_unittest.cc

Issue 2649143003: PaymentRequest: The currencySystem should be non-nullable. (Closed)
Patch Set: PaymentRequest: The currencySystem should be non-nullable. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/payments/currency_formatter.h" 5 #include "components/payments/currency_formatter.h"
6 6
7 #include "base/optional.h" 7 #include "base/optional.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 14 matching lines...) Expand all
25 expected_amount(expected_amount), 25 expected_amount(expected_amount),
26 expected_currency_code(expected_currency_code), 26 expected_currency_code(expected_currency_code),
27 currency_system(currency_system) {} 27 currency_system(currency_system) {}
28 ~TestCase() {} 28 ~TestCase() {}
29 29
30 const char* const amount; 30 const char* const amount;
31 const char* const currency_code; 31 const char* const currency_code;
32 const char* const locale_name; 32 const char* const locale_name;
33 const std::string expected_amount; 33 const std::string expected_amount;
34 const char* const expected_currency_code; 34 const char* const expected_currency_code;
35 const base::Optional<std::string> currency_system; 35 const char* const currency_system;
36 }; 36 };
37 37
38 class PaymentsCurrencyFormatterTest : public testing::TestWithParam<TestCase> { 38 class PaymentsCurrencyFormatterTest : public testing::TestWithParam<TestCase> {
39 }; 39 };
40 40
41 TEST_P(PaymentsCurrencyFormatterTest, IsValidCurrencyFormat) { 41 TEST_P(PaymentsCurrencyFormatterTest, IsValidCurrencyFormat) {
42 CurrencyFormatter formatter(GetParam().currency_code, 42 CurrencyFormatter formatter(GetParam().currency_code,
43 GetParam().currency_system, 43 GetParam().currency_system,
44 GetParam().locale_name); 44 GetParam().locale_name);
45 base::string16 output_amount = formatter.Format(GetParam().amount); 45 base::string16 output_amount = formatter.Format(GetParam().amount);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 "JPY", 169 "JPY",
170 "http://currsystem.com"), 170 "http://currsystem.com"),
171 TestCase("0.1234", 171 TestCase("0.1234",
172 "USD", 172 "USD",
173 "en_US", 173 "en_US",
174 "0.1234", 174 "0.1234",
175 "USD", 175 "USD",
176 "http://currsystem.com"))); 176 "http://currsystem.com")));
177 177
178 } // namespace payments 178 } // namespace payments
OLDNEW
« no previous file with comments | « components/payments/currency_formatter.cc ('k') | components/payments/payment_details_validation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698