Class TestHelper
- Namespace
- SunamoTest
- Assembly
- SunamoTest.dll
Provides helper methods for initializing and managing test environments.
public class TestHelper
- Inheritance
-
TestHelper
- Inherited Members
- Extension Methods
Methods
DefaultFolderPath()
Returns the default folder path for test files based on the current application name and project.
public static string DefaultFolderPath()
Returns
- string
The default folder path.
FolderForTestFiles(object)
Returns the backslash-terminated folder path for test files of the specified feature.
public static string FolderForTestFiles(object featureOrType)
Parameters
featureOrTypeobjectA Type, string, or object whose class name identifies the feature.
Returns
- string
The folder path for test files.
GetFileInProjectsFolder(string, string)
Returns the full path to a file relative to the project folder within the specified base directory. The path is combined with ThisApp.Name and ThisApp.Project.
public static string GetFileInProjectsFolder(string projectsBasePath, string fileRelativeToProjectPath)
Parameters
projectsBasePathstringThe base directory containing the projects.
fileRelativeToProjectPathstringThe file path relative to the project folder.
Returns
- string
The full path to the file.
Init()
Initializes the test environment with default application name "sunamo".
public static void Init()
Init(string)
Initializes the test environment with the specified application name.
public static void Init(string appName)
Parameters
appNamestringThe name of the application to initialize for testing.
RefreshOriginalFiles(string, object, string, bool, bool)
Refreshes the original test files by copying them from the original folder to the working folder. Optionally replaces occurrences of "_Original" in file names and content.
public static Task<List<string>> RefreshOriginalFiles(string baseFolder, object featureOrType, string modeOfFeature, bool isCopyingFilesRecursively, bool isReplacingOriginal)
Parameters
baseFolderstringThe base folder path. If null, uses the default folder path.
featureOrTypeobjectA Type, string, or object whose class name identifies the feature.
modeOfFeaturestringAn optional subfolder mode within the feature folder. Can be null or empty.
isCopyingFilesRecursivelyboolWhether to copy files from subfolders recursively.
isReplacingOriginalboolWhether to replace "_Original" in file names and content.
Returns
TestFile(object, string)
Returns the full path to a test file within the feature's test folder.
public static string TestFile(object featureOrType, string fileName)
Parameters
featureOrTypeobjectA Type, string, or object whose class name identifies the feature.
fileNamestringThe name of the test file.
Returns
- string
The full path to the test file.