-
Notifications
You must be signed in to change notification settings - Fork 0
BaseUnitTestWriter
This is a C# code file that defines an abstract class called BaseUnitTestWriter. The class provides a foundation for writing unit tests for enums. The class has several properties that determine the behavior of the unit test writing process, and methods for generating and writing unit test files.
The class contains the following members:
AssertType enum: represents the type of the assert statement to use in the generated test methods.
UnitTestFrameworkType enum: represents the type of the unit test framework to use when generating unit test files.
_selectedAssembly field: an enumerable of strings that specifies the assemblies to generate unit tests for.
_path field: a string representing the path to the directory where the unit test files will be written.
_overWriteTests field: a boolean indicating whether to overwrite existing unit test files.
SetTestAssertType method: sets the value of the _assertType field and returns the instance of the BaseUnitTestWriter class.
SetTestFrameworkType method: sets the value of the _testFrameworkType field and returns the instance of the BaseUnitTestWriter class.
SetCreationPath method: sets the value of the _path field and returns the instance of the BaseUnitTestWriter class.
SetAssemblies method: sets the value of the _selectedAssembly field and returns the instance of the BaseUnitTestWriter class.
OverwriteTests method: sets the value of the _overWriteTests field and returns the instance of the BaseUnitTestWriter class.
Write method: generates and writes the unit test files for the specified enums and returns a tuple containing a boolean indicating the success of the operation and an exception if an error occurred.
WriteClassTest method: a virtual method that generates the test class for the enum type. This method can be overridden in derived classes to customize the generation of the test class.
WriteMethodTest method: a virtual method that generates the test method for a specific enum value. This method can be overridden in derived classes to customize the generation of the test method.
WriteBorderMethodTest method: a virtual method that generates the test method for a value outside of the enum range. This method can be overridden in derived classes to customize the generation of the test method.