Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add Support Data Providers #6

Open
hyyan opened this issue Mar 2, 2020 · 0 comments
Open

[Feature Request] Add Support Data Providers #6

hyyan opened this issue Mar 2, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hyyan
Copy link
Member

hyyan commented Mar 2, 2020

A data provider method is a public method and either returns an array of arrays or an object that implements the Iterator interface and yields an array for each iteration step. For each item that is part of the collection, the test method will be called with the contents as its arguments.

This concept is similar to PHPUnit data providers

use java.sql.Types

class public UnitTestClass
    
    method public HashMap getSQLNumberTypes()
       map! = new HashMap()
       
       map!.put("Types.BIGINT" , Types.BIGINT)
       map!.put("Types.TINYINT" , Types.TINYINT)
       map!.put("Types.SMALLINT",Types.SMALLINT)
       map!.put("Types.INTEGER",Types.INTEGER)
       map!.put("Types.DECIMAL",Types.DECIMAL)
       map!.put("Types.DOUBLE",Types.DOUBLE)
       map!.put("Types.FLOAT",Types.FLOAT)
       map!.put("Types.REAL",Types.REAL)
       map!.put("Types.NUMERIC",Types.NUMERIC)
       
       methodret map!
    methodend 
    
    rem @Test
    rem @DataProvider getSQLNumberTypes
    method public void testMethod(BBjString key! , BBjNumber val!)
            Assert.Equals(val! >0 , BBjAPI.TRUE )
    methodend      
classend

@SebastianAdams SebastianAdams added the enhancement New feature or request label Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants