0% found this document useful (0 votes)
4 views1 page

Lab 1

Lab 1 for CS321L Winter 2023 involves creating NUnit tests in Visual Studio, focusing on two functions: 'TestLiterals' to print type representations of various expressions and 'TestLetters' to print ASCII letters. Students are required to set breakpoints and capture screenshots of outputs and the Locals Window during debugging. Submission includes screenshots and the C# code file with the test functions.

Uploaded by

mbielawski21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Lab 1

Lab 1 for CS321L Winter 2023 involves creating NUnit tests in Visual Studio, focusing on two functions: 'TestLiterals' to print type representations of various expressions and 'TestLetters' to print ASCII letters. Students are required to set breakpoints and capture screenshots of outputs and the Locals Window during debugging. Submission includes screenshots and the C# code file with the test functions.

Uploaded by

mbielawski21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab 1

CS321L Winter 2023, Professor Christopher Diggins

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:

• Screen shot of function output of the “TestLiterals()” function – 1 point


• Screen shot of function output of the “TestLetters()” function – 1 point
• Screen shot the “Locals Window” on the fifth iteration of the “TestLetters” loop – 1 point
• C# code file (.cs) containing the “TestLiterals()” and “TestLetters()” function – 1 point

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

You might also like