Ed Tanous | c5ba4c2 | 2022-02-07 09:59:55 -0800 | [diff] [blame] | 1 | #include "registries.hpp" |
| 2 | |
Nan Zhou | d5c80ad | 2022-07-11 01:16:31 +0000 | [diff] [blame] | 3 | #include <gtest/gtest.h> // IWYU pragma: keep |
| 4 | |
| 5 | // IWYU pragma: no_include <gtest/gtest-message.h> |
| 6 | // IWYU pragma: no_include <gtest/gtest-test-part.h> |
| 7 | // IWYU pragma: no_include "gtest/gtest_pred_impl.h" |
Ed Tanous | c5ba4c2 | 2022-02-07 09:59:55 -0800 | [diff] [blame] | 8 | |
Nan Zhou | 38ead5e | 2022-07-03 23:07:27 +0000 | [diff] [blame] | 9 | namespace redfish::registries |
| 10 | { |
| 11 | namespace |
| 12 | { |
| 13 | |
Nan Zhou | 7ea4643 | 2022-07-03 23:55:10 +0000 | [diff] [blame] | 14 | TEST(FillMessageArgs, ArgsAreFilledCorrectly) |
Ed Tanous | c5ba4c2 | 2022-02-07 09:59:55 -0800 | [diff] [blame] | 15 | { |
Ed Tanous | c5ba4c2 | 2022-02-07 09:59:55 -0800 | [diff] [blame] | 16 | std::string toFill("%1"); |
| 17 | fillMessageArgs({{"foo"}}, toFill); |
| 18 | EXPECT_EQ(toFill, "foo"); |
| 19 | |
| 20 | toFill = ""; |
| 21 | fillMessageArgs({}, toFill); |
| 22 | EXPECT_EQ(toFill, ""); |
| 23 | |
| 24 | toFill = "%1, %2"; |
| 25 | fillMessageArgs({{"foo", "bar"}}, toFill); |
| 26 | EXPECT_EQ(toFill, "foo, bar"); |
| 27 | } |
Nan Zhou | 38ead5e | 2022-07-03 23:07:27 +0000 | [diff] [blame] | 28 | } // namespace |
| 29 | } // namespace redfish::registries |