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

handle cases when return type is '[void]' or not specified #128

Open
Stephanevg opened this issue Jul 26, 2021 · 0 comments
Open

handle cases when return type is '[void]' or not specified #128

Stephanevg opened this issue Jul 26, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Stephanevg
Copy link
Owner

When not specified, it should be considuered as VOID.

This is an example of what the current version generates:

#Public Method
    It '[AnsibleVariableCollection] --> SetVariables($Variables) :  - should return type []' {

        # -- Arrange
        [AnsibleVar[]]$Variables = ''

        # -- Act

        $Instance = [AnsibleVariableCollection]::New()
        # -- Assert

        ($Instance.SetVariables($Variables)).GetType().Name | should be 

    } #End It Block

This is what it should actually look like:

#Public Method
    It '[AnsibleVariableCollection] --> SetVariables($Variables) :  - should return type []' {

        # -- Arrange
        $Variables = @()
        $Variables += [AnsibleVar]::New('var1', 'val1', 'host1')
        $Variables += [AnsibleVar]::New('var2', 'val2', 'host2')
        

        # -- Act

        $Instance = [AnsibleVariableCollection]::New()
        # -- Assert

        $Instance.SetVariables($Variables) | should be $null

    } #End It Block
@Stephanevg Stephanevg added bug Something isn't working enhancement New feature or request labels Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant