Generate random data
Writing out the input data by hand is tedious, and violates the moral code of the efficient tester: let the machine do the work!. To automate this BlueDuck SDA comes with a set of data generators for some basic data.
Writing out the input data by hand is tedious, and violates the moral code of the efficient tester: let the machine do the work!. To automate this BlueDuck SDA comes with a set of data generators for some basic data.
Including SDA Core
#include <../../lib/sda.core.au3>
Get a new Test object instance
Func TestDataGenerator() Local $TestOne Local $TestData ;New Test $TestOne = NewTest("TestDataGenerator") ;Test Settings $TestOne.ScreenCapture = False ;Start Test $TestOne.Setup() ;Test Report $TestOne.Report.Create
Get a new Random data object instance
;Data generator $TestData = $TestOne.NewDataGenerator() $TestOne.AddStepResult("Random Name",$TestData.Name,1) $TestOne.AddStepResult("Random City",$TestData.City,1) $TestOne.AddStepResult("Random Country",$TestData.Country,1) $TestOne.AddStepResult("Random ValidEmail",$TestData.ValidEmail,1) $TestOne.AddStepResult("Random inValidEmail",$TestData.InValidEmail,1) $TestOne.AddStepResult("Random Alphanumeric",$TestData.Alphanumeric,1) $TestOne.AddStepResult("Random Number",$TestData.Number,1)
Close Test
$TestOne.Report.Close EndFunc
Run Test
TestDataGenerator()
Test result
Method | Description | Parameters |
---|---|---|
Number | Generates a pseudo-random float-type number |
|
Alphanumeric | Generates a pseudo-random alphanumeric |
|
Country | Generates a random Country | |
City | Generates a random City | |
Name | This data type randomly generates human names. | |
ValidEmail | Generates a random valid email address according to RFC 2822 | |
inValidEmail | Generates a random invalid email address according to RFC 2822 |