Lab 1
Lab 1
Overview
This lab focuses on creating NUnit tests on Visual Studio. If you find a way to recreate the steps using
Visual Studio for Mac and another unit test framework (e.g., xUnit) that is acceptable, but it is not
recommended.
Tasks
A) Create an NUnit test project (.NET Framework 6).
B) In that project create a static test function named “TestLiterals” to print the string
representation run-time type of the following expressions. Run the test project from the “test
explorer” window.
a. “Hello”, 123, 12.34, 1.23f, true, ‘t’, 0xFFul
C) In the same project and file create a static test function “TestLetters” that loops through all
ASCII codes (0 to 127) and print only letters. Use the system function “Char.IsLetter”
D) Set a breakpoint in the loop of the “TestLetters” function.
a. Step through the code.
b. On the fifth iteration of the loop (loop index == 4), screen shot the “Locals Window”.
Submission
Submit a zip file containing the following:
Resources
• Running Unit Tests with Test Explorer in Visual Studio 2022 - https://learn.microsoft.com/en-
us/visualstudio/test/run-unit-tests-with-test-explorer?view=vs-2022
• Debugging Unit Tests with Test Explorer in Visual Studio 2022 - https://learn.microsoft.com/en-
us/visualstudio/test/debug-unit-tests-with-test-explorer?view=vs-2022
• Inspect Variables in the Autos and Locals Windows - https://learn.microsoft.com/en-
us/visualstudio/debugger/autos-and-locals-windows?view=vs-2022
• Testing Tools for Visual Studio for Mac - https://learn.microsoft.com/en-
us/visualstudio/mac/testing?view=vsmac-2022
• Data visualizations for Visual Studio for Mac - https://learn.microsoft.com/en-
us/visualstudio/mac/data-visualizations?view=vsmac-2022