By: Paul S. Cilwa | Viewed: 5/20/2024 Posted: 1/23/2022 Updated: 1/30/2022 |
Page Views: 868 | |
Topics: #Organica #VisualBasic #VB.NET #ClassLibrary #OrganicaLib #Settings #TestBed | |||
Testing the Settings class. |
Properly testing every single method in the Settings class would basically result in a .INI file editor, which is more work than I want to put into this right now. Besides, just getting it to list all the sections and keys and values, will exercise 96% of the code.
Use Visual Studio to open the OrganicaLib Test Bed solution, and then load the Frame.vb file into the editor. Add a button labeled "Settings" and give it the name cmd_Settings. (Depending on what order you've done these components, your buttons may or may not look like these.)
When you're happy with your layout, double-click on the Settings button to get to its code window.
Private Async Sub cmd_Settings_Click(sender As Object, e As EventArgs) Handles cmd_Settings.Click
Dim TestIt As New Settings("c:\Windows\system.ini")
Dim Result As New StringBuilder
Result.Append(StartHtml)
Result.AppendLine(TestIt.ToHtml)
Result.Append(ConcludeHtml)
Await Browser.EnsureCoreWebView2Async()
Browser.CoreWebView2.NavigateToString(Result)
End Sub
Results
Run the app and click the button. This should be the result.