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

100% Code Coverage for Get-GraphOauthAuthorizationCode #18

Open
markekraus opened this issue Apr 22, 2017 · 0 comments
Open

100% Code Coverage for Get-GraphOauthAuthorizationCode #18

markekraus opened this issue Apr 22, 2017 · 0 comments

Comments

@markekraus
Copy link
Owner

Code coverage report:
Covered 0 % of 53 analyzed Commands in Get-GraphOauthAuthorizationCode
Missed commands:

Line Command
64 if (-not $pscmdlet.ShouldProcess($Application.ClientID)) { ...
67 $Client_Id = [System.Web.HttpUtility]::UrlEncode($Application.ClientId)
68 $Redirect_Uri = [System.Web.HttpUtility]::UrlEncode($Application.RedirectUri)
69 $Url = "{0}?response_type=code&redirect_uri={1}&client_id={2}" -f @( ...
70 $BaseURL
71 $Redirect_Uri
72 $Client_Id
74 Write-Verbose "URL: '$URL'"
75 $Params = @{ ...
76 TypeName = 'System.Windows.Forms.Form'
77 Property = @{ ...
78 Width = 440
79 Height = 640
82 $Form = New-Object @Params
83 $Params = @{ ...
84 TypeName = 'System.Windows.Forms.WebBrowser'
85 Property = @{ ...
86 Width = 420
87 Height = 600
88 Url = $Url
91 $Web = New-Object @Params
92 $DocumentCompleted_Script = { ...
93 if ($web.Url.AbsoluteUri -match "error=[^&]*...
94 $form.Close()
98 $web.ScriptErrorsSuppressed = $false
99 $web.Add_DocumentCompleted($DocumentCompleted_Script)
100 $form.Controls.Add($web)
101 $form.Add_Shown({ $form.Activate() })
101 $form.Activate()
102 [void]$form.ShowDialog()
104 $QueryOutput = [System.Web.HttpUtility]::ParseQueryString($web.Url.Query)
105 $Response = @{ }
106 $queryOutput.Keys
107 $Response["$key"] = $QueryOutput[$key]
109 $SecAuthCode = 'NOAUTHCODE' ...
109 $SecAuthCode = 'NOAUTHCODE' ...
110 $AuthCodeCredential = [pscredential]::new('NOAUTHCODE', $SecAuthCode)
111 if ($Response.Code) { ...
112 $SecAuthCode = $Response.Code ...
112 $SecAuthCode = $Response.Code ...
113 $AuthCodeCredential = [pscredential]::new('AuthCode', $SecAuthCode)
114 $Response.Remove('Code')
116 [pscustomobject]@{ ...
117 PSTypeName = 'MSGraphAPI.Oauth.AuthorizationCode'
118 AuthCodeCredential = $AuthCodeCredential
119 ResultURL = $web.Url.psobject.copy()
120 Application = $Application
121 AuthCodeBaseURL = $BaseURL
122 Response = $Response
123 Issued = Get-date
125 [void]$form.Close()
126 [void]$Web.Dispose()
127 [void]$Form.Dispose()
@markekraus markekraus added this to the 100% Code Coverage milestone Apr 22, 2017
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

1 participant