PowerShell module providing several cmdlets supporting data and code generation.
There are 2 different stages of testing. The TestDataGeneration.UnitTests test the underlying components of the nested binary module. The second is the Pester unit tests, included in this project, which tests the functionality within PowerShell.
Files with the extension .tests.ps1 contain the code for unit tests. Simply invoking the Invoke-Pester command will run these tests.
Note: Tests will only work if they are invoked from the compilation output folder or from the deployed location of the module.
The /.vscode/launch.json provides a launch configuration to allow the Pester tests to be executed from withing VS Code.
You may see errors such as The BeforeAll command may only be used inside a Describe block. or RuntimeException: '-Be' is not a valid Should operator..
Additionally, you may see a VS code extension error stating Test Discovery failed: A terminating error was received from PowerShell: Pester 5.2.0 or greater is required.
This may occur if version 3 or older is installed. To check the version of Pester, execute the following command to make sure you're using at least version 4:
Get-Module -Name 'Pester' -ListAvailableYou can run the following command to install the latest version:
Install-Module -Name Pester -Force -SkipPublisherCheckNumberStyles.AllowLeadingWhiteandNumberStyles.AllowTrailingWhiteNumberStyles.AllowLeadingSignandNumberStyles.AllowTrailingSignNumberFormatInfo.PositiveSignNumberFormatInfo.NegativeSign
NumberStyles.AllowParentheses- Only one set of parentheses per number.NumberStyles.AllowDecimalPointNumberFormatInfo.CurrencyDecimalSeparatorifNumberStyles.AllowCurrencySymbol; otherwise,NumberFormatInfo.NumberDecimalSeparator
NumberStyles.AllowThousandsNumberFormatInfo.CurrencyGroupSeparatorifNumberStyles.AllowCurrencySymbol; otherwise,NumberFormatInfo.NumberGroupSeparator
NumberStyles.AllowExponent- formats following number:[Ee][+-]?\d+(nnnExx,nnnE+xxandnnnE-xx). Sign for number precedes the number or follows the exponentNumberStyles.AllowCurrencySymbol- Uses
NumberFormatInfo.CurrencyDecimalSeparatorifNumberStyles.AllowDecimalPoint - Uses
NumberFormatInfo.CurrencyGroupSeparatorifNumberStyles.AllowThousands
- Uses
NumberStyles.AllowHexSpecifier- Allows lettersatofandAtoFfor digits.
- Import FsInfoCat.Numerics
public const double EPSILON = 1.0e-15;
ulong fact = 1;
double e = 2.0;
double e0;
uint n = 2;
do
{
e0 = e;
fact *= n++;
e += 1.0 / fact;
}
while (Math.Abs(e - e0) >= EPSILON);General development reference links
- Math Class in C#
- Character Name Index - unicode.org
- UTF-8, UTF-16, UTF-32 & BOM - unicode.org
- U0000.pdf: C0 Controls and Basic Latin - unicode.org
- RFC 3629 - UTF-8, a transformation format of ISO 10646
- RFC 2781 - UTF-16, an encoding of ISO 10646
- RFC 2152 - UTF-7
- UTF-16 - Wikipedia
- UTF-8 - Wikipedia
- PowerShell
- c# Documentation Comments