Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. void TestAllTypes(wstring filename)
  2. {
  3. Logger::WriteMessage(filename.c_str());
  4.  
  5. wstring xml = ReadFile(filename);
  6. Logger::WriteMessage(xml.c_str());
  7.  
  8. // Ensure five items
  9. Assert::IsTrue(regex_search(xml, wregex(L"<aqua><item.*<item.*<item.*<item.*<item.*</aqua>")));
  10.  
  11. // Ensure the positions are correct
  12. Assert::IsTrue(regex_search(xml, wregex(L"<item x=\"100\" y=\"200\"")));
  13. Assert::IsTrue(regex_search(xml, wregex(L"<item x=\"400\" y=\"400\"")));
  14. Assert::IsTrue(regex_search(xml, wregex(L"<item x=\"600\" y=\"100\"")));
  15. Assert::IsTrue(regex_search(xml, wregex(L"<item x=\"100\" y=\"500\"")));
  16. Assert::IsTrue(regex_search(xml, wregex(L"<item x=\"700\" y=\"600\"")));
  17.  
  18. // Ensure the types are correct
  19. Assert::IsTrue(regex_search(xml,
  20. wregex(L"<aqua><item.* type=\"beta\"/><item.* type=\"magikarp\"/><item.* type=\"sparty\"/><item.* type=\"carp\"/><item.* type=\"scull\"/></aqua>")));
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement