blob: 87b92dcf8c6804386aef0e44d104ad76a28ecf2b [file] [log] [blame]
Ed Tanousc5ba4c22022-02-07 09:59:55 -08001#include "registries.hpp"
2
Nan Zhoud5c80ad2022-07-11 01:16:31 +00003#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 Tanousc5ba4c22022-02-07 09:59:55 -08008
Nan Zhou38ead5e2022-07-03 23:07:27 +00009namespace redfish::registries
10{
11namespace
12{
13
Nan Zhou7ea46432022-07-03 23:55:10 +000014TEST(FillMessageArgs, ArgsAreFilledCorrectly)
Ed Tanousc5ba4c22022-02-07 09:59:55 -080015{
Ed Tanousc5ba4c22022-02-07 09:59:55 -080016 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 Zhou38ead5e2022-07-03 23:07:27 +000028} // namespace
29} // namespace redfish::registries