Converts C# XUnit tests to NUnit tests
npm install xunit-to-nunitbash
npm install xunit-to-nunit
`
Usage
$3
`javascript
var x2n = require('xunit-to-nunit')
`
$3
`javascript
var nunitTest = x2n.convertCode(xunitTest)
`
$3
`javascript
x2n.convertFile('xunit-source-path.cs', 'nunit-destination-path.cs')
`
$3
`javascript
x2n.convertFiles('xunit/source/directory', 'nunit/destination/directory')
`
This function calls convertFile for all files in the source directory.
#### Options
convertFiles has a third (optional) parameter: options. This should be a dictionary value, containing all or any of the following parameters:
##### :wrench: recursive (default: false)
Set to true, this parameter will convert tests in all subdirectories including those at the source root. Directory structure is maintained at the conversion destination.
##### :wrench: verbose (default: true)
When true, the module logs an info message to the terminal when a file is converted. When a file conversion fails, a error log message is displayed regardless of the value of verbose.
For example,
`javascript
var options = {
recursive: true,
verbose: false
}
x2n.convertFiles('xunit/source/directory', 'nunit/destination/directory', options)
`
#### Writing converted tests to source directory
When _source = destination_, '_NUnit' is appended to the filename. For example, where _destination = dir_, dir/SomeTests.cs is converted and the result is written to dir/SomeTests_NUnit.cs.
This behaviour can be changed with the following parameters:
##### :wrench: append (default: '_NUnit')
String to be appended to filenames when writing destination files to the source directory.
##### :wrench: overwrite (default: false)
If _overwrite = true_, append is ignored, and source files are overwritten at destination.
For example,
`javascript
// Append destination filenames with append text
var options = {
append: '_Test',
overwrite: false // overwrite is false by default
}
// or, overwrite source files
var options = {
overwrite: true
}
x2n.convertFiles('xunit/source/directory', 'nunit/destination/directory', options)
``