/* * Copyright 2020, Andrew Lindesay . * All rights reserved. Distributed under the terms of the MIT License. */ #include "StorageUtilsTest.h" #include #include #include #include "StorageUtils.h" StorageUtilsTest::StorageUtilsTest() { } StorageUtilsTest::~StorageUtilsTest() { } void StorageUtilsTest::TestSwapExtensionOnPathComponent() { const BString input = "/paved/path.tea"; // ---------------------- BString output = StorageUtils::SwapExtensionOnPathComponent(input, "chai"); // ---------------------- const BString expected = "/paved/path.chai"; CPPUNIT_ASSERT_EQUAL(expected, output); } /*static*/ void StorageUtilsTest::AddTests(BTestSuite& parent) { CppUnit::TestSuite& suite = *new CppUnit::TestSuite("StorageUtilsTest"); suite.addTest( new CppUnit::TestCaller( "StorageUtilsTest::TestSwapExtensionOnPathComponent", &StorageUtilsTest::TestSwapExtensionOnPathComponent)); parent.addTest("StorageUtilsTest", &suite); }