1 /* 2 * Copyright (C) 2020 Damir Porobic <damir.porobic@gmx.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef KSNIP_PATHHELPERTESTS_H 21 #define KSNIP_PATHHELPERTESTS_H 22 23 #include <QtTest> 24 25 class PathHelperTests : public QObject 26 { 27 Q_OBJECT 28 private slots: 29 void IsPathValid_Should_ReturnFalse_When_StringEmpty(); 30 void IsPathValid_Should_ReturnFalse_When_StringNull(); 31 void IsPipePath_Should_ReturnTrue_When_PathIsDash(); 32 void IsPipePath_Should_ReturnFalse_When_PathIsNull(); 33 void IsPipePath_Should_ReturnFalse_When_PathIsEmpty(); 34 void IsPathValid_Should_ReturnTrue_When_StringHasContent(); 35 void ExtractParentDirectory_Should_ReturnStringWithParentDirectoryPath(); 36 void ExtractFilename_Should_ReturnStringWithFilenameWithoutFormat_When_FormatExists(); 37 void ExtractFilename_Should_ReturnStringWithFilenameWithoutFormat_When_NoFormatExists(); 38 void ExtractFilenameWithFormat_Should_ReturnStringWithFilenameWithFormat_When_FormatExists(); 39 void ExtractFilenameWithFormat_Should_ReturnStringWithFilenameWithFormat_When_NoFormatExists(); 40 void ExtractFormat_Should_ReturnWithFormat_When_FormatExists(); 41 void ExtractFormat_Should_ReturnEmptyString_When_NoFormatExists(); 42 }; 43 44 #endif //KSNIP_PATHHELPERTESTS_H 45