Click here to Skip to main content
15,900,694 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the unit test project which has n number of test methods like below,

C#
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BankTests
{
    [TestClass]
    public class BankAccountTests
    {
        [TestMethod]
        public void TestMethod1()
        {
        }
             and so on....

    }
}


So my question is HOW CLR treats all test methods?
Posted

1 solution

The same way it treats everything else.

There's nothing special about unit tests, they are just functions like any other. We mark them with Custom Attributes to identify classes and individual tests, but that is just so that the test runner can identify them.

Unless you're using some integrated test runner, you shell out to the test runner gui which loads your test assembly, identifies the tests, calls them and collects the results. None of this has any special treatment by the CLR.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900