Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Class notes ENGLISH 124

Rating
-
Sold
-
Pages
8
Uploaded on
12-06-2022
Written in
2021/2022

Unit Testing in Asp.Net: Complete Tutorial

Institution
Course

Content preview

Lab 8.1 - Unit Testing in Asp.Net: Complete Tutorial

Testing is an essential aspect of any programming language. Testing for ASP.Net applications
is possible with the help of Visual Studio.
Visual Studio is used to create test code. It is also used to run the test code for an ASP.Net
application. In this way, it becomes simple to check for any errors in an ASP.Net application.
In Visual Studio, the testing module comes with an out of box functionality. One can
straightaway perform a test for an ASP.Net project.
In this tutorial, you will learn
 Introduction to testing for ASP.Net
 Creating a .NET Unit Testing Project
 Running the Test Project

Introduction to testing for ASP.Net
The first level of testing an ASP.Net project is unit level testing. This test is the functionality of an
application. The testing is conducted to ensure that the application behaves as expected. In
ASP.Net, the first task is to create a test project in Visual Studio. The test project will contain the
necessary code to test the application.
Let's consider the below web page. In the page, we have the message "Guru99 – ASP.Net"
displayed. Now how can we confirm that the correct message is displayed when an ASP.Net
project runs. This is done by adding a test project to the ASP.Net solution (used to develop web-
based applications). This test project would ensure that the right message is displayed to the user.




Let's look into more detail now and see how we can work on testing in ASP.Net.

Lab Objectives
After completing this lab, students will gain practical experience with:
 Creating a .NET Unit Testing Project
 Running the Test Project




Unit Testing
This study source was downloaded by 100000825543056 in Asp.Net:onComplete
from CourseHero.com 06-12-2022Tutorial 8.1-1
05:12:31 GMT -05:00


https://www.coursehero.com/file/94204528/Lab-81-Unit-Testing-in-AspNet-Complete-Tutorial-240119-HAdoc/

, Lab Procedures

A. Creating a .NET Unit Testing Project
Before we create a test project, we need to perform the below high-level steps.
1. Use our 'DemoApplication' used in the earlier sections. This will be our application
which needs to be tested.
2. We will add a new class to the DemoApplication. This class will contain a string
called 'Guru99 – ASP.Net.' This string will be tested in our testing project.
3. Finally, we will create a testing project. This is used to test the ASP.Net application.
So let's follow the above high-level steps and see how to implement testing.
Step 1) Ensure the DemoApplication is open in Visual Studio.
Step 2) Let's now add a new class to the DemoApplication. This class will contain a
string called 'Guru99 – ASP.Net.' This string will be tested in our testing project.
Follow below step to add a new class.




1. In Visual Studio, right-click the 'DemoApplication' in the Solution Explorer.
2. Choose the option Add  Class from the context menu.
Step 3) In this step,




1. Give a name 'Tutorial.cs' for the new class.
2. Click the 'Add' button to add the file to the DemoApplication.
Now, a new class is added to file "DemoApplication."
Step 4) Open the new Tutorial.cs file from "DemoApplication". Add the string "Guru99
– ASP.Net."


Unit Testing
This study source was downloaded by 100000825543056 in Asp.Net:onComplete
from CourseHero.com 06-12-2022Tutorial 8.1-2
05:12:31 GMT -05:00


https://www.coursehero.com/file/94204528/Lab-81-Unit-Testing-in-AspNet-Complete-Tutorial-240119-HAdoc/

Written for

Course

Document information

Uploaded on
June 12, 2022
Number of pages
8
Written in
2021/2022
Type
Class notes
Professor(s)
Mr. stephen
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
SirLameck Cambridge College
Follow You need to be logged in order to follow users or courses
Sold
31
Member since
4 year
Number of followers
2
Documents
295
Last sold
7 hours ago
NOTES BY LAMECK!!!

PrimePrep Docs!!!! Welcome to My Academic Store! Hey! I\'m Sir Lameck — a passionate tutor and researcher, here to make academic content clear, simple, and super effective. Every resource is built from real understanding and designed to help you learn smarter, not harder. What you’ll find here: * Exam-ready notes & summaries * Test banks, solution manuals & more * Clear explanations & helpful visuals * Student-friendly, time-saving content Thanks for stopping by — now let’s boost those grades!

Read more Read less
4.0

4 reviews

5
2
4
1
3
0
2
1
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions