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] Introduce new annotation to mark unti test classes #5

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

Comments

@hyyan
Copy link
Member

hyyan commented Mar 2, 2020

A common need is to define proxy/mock in the same file where the unit test class lives,
If the proxy was written before the unit test class, then the following error will be thrown

!ERROR=252  (No match for method ::C:/Users/habof/AppData/Local/Temp/BBjUnitTest
1583140459530/BBjGridExWidgetCellEditorAGPopupSelectTest.bbjt::BBjGridExWidgetCe
llEditorAGPopupSelectProxy.setUp())
[15] call "C:\Users\habof\AppData\Local\Temp\BBjUnitTest1583140459530\BBjGridExW
idgetCellEditorAGPopupSelectTest.bbjt"
# BBjGridExWidgetCellEditorAGPopupSelectTest.bbjt

use ::BBjGridExWidget/BBjGridExWidgetCellEditors.bbj::BBjGridExWidgetCellEditorAGPopupSelect
use com.google.gson.JsonObject
use com.google.gson.JsonArray
use com.google.gson.JsonNull

class public BBjGridExWidgetCellEditorAGPopupSelectProxy extends BBjGridExWidgetCellEditorAGPopupSelect
    rem /**
    rem  * @override
    rem  */
    method protected static BBjNumber isBUI()
        methodret 1
    methodend
classend

class public BBjGridExWidgetCellEditorAGPopupSelectTest

    field private BBjGridExWidgetCellEditorAGPopupSelect Instance!
    
    rem @Before
    method public void setUp()
        #Instance! = new BBjGridExWidgetCellEditorAGPopupSelect()
    methodend

    rem @Test
    method public void testCellEditorNameIsSet()
        Assert.Equals(#Instance!.getCellEditorName() , "agPopupSelectCellEditor")
    methodend
    
    rem @Test
    method public void testFallbackToAGSelect()
        proxy! = new BBjGridExWidgetCellEditorAGPopupSelectProxy()
        Assert.Equals(proxy!.getCellEditorName() , "agSelectCellEditor")
    methodend    
            
    rem @After
    method public void tearDown()
        #Instance! = null()
    methodend
classend

moving the proxy to be defined at the end of the file solves the problem, but it would a nice feature if we can just introduce a new annotation (ex : @UnitTest) to mark a class as a unit test

@hyyan hyyan changed the title Introduce new annotation to mark unti test classes [Feature Request] Introduce new annotation to mark unti test classes Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants