| 118 | } |
| 119 | |
| 120 | TEST_METHOD(ParseHelp) |
| 121 | { |
| 122 | auto& result = parser.getSwitches(); |
| 123 | std::array const expectedFlags |
| 124 | { |
| 125 | "/A", |
| 126 | "/M", |
| 127 | "/D:m-d-y", |
| 128 | "/EXCLUDE:file1[+file2][+file3]...", |
| 129 | "/P", |
| 130 | "/S", |
| 131 | "/E", |
| 132 | "/V", |
| 133 | "/W", |
| 134 | "/C", |
| 135 | "/I", |
| 136 | "/-I", |
| 137 | "/Q", |
| 138 | "/F", |
| 139 | "/L", |
| 140 | "/G", |
| 141 | "/H", |
| 142 | "/R", |
| 143 | "/T", |
| 144 | "/U", |
| 145 | "/K", |
| 146 | "/N", |
| 147 | "/O", |
| 148 | "/X", |
| 149 | "/Y", |
| 150 | "/-Y", |
| 151 | "/Z", |
| 152 | "/B", |
| 153 | "/J", |
| 154 | "/COMPRESS", |
| 155 | "/SPARSE" |
| 156 | }; |
| 157 | Assert::AreEqual( |
| 158 | result.size(), |
| 159 | expectedFlags.size(), |
| 160 | L"Parse xcopy commands failed, number of parsed flags does not match"); |
| 161 | |
| 162 | for (auto expectedFlag : expectedFlags) |
| 163 | { |
| 164 | Assert::IsTrue( |
| 165 | result.find(expectedFlag) != result.end(), |
| 166 | (winrt::hstring{ L"Parse xcopy commands failed, lacking flag: " } + winrt::to_hstring(expectedFlag)).data() |
| 167 | ); |
| 168 | Assert::IsFalse( |
| 169 | result.find(expectedFlag)->second.empty(), |
| 170 | (winrt::hstring{L"Parse xcopy commands failed, flag: "} + winrt::to_hstring(expectedFlag) + L" does not have description").data() |
| 171 | ); |
| 172 | } |
| 173 | } |
| 174 | }; |
| 175 | |
| 176 | TEST_CLASS(FastCopyShellExtensionTest) |
nothing calls this directly
no test coverage detected