Create new test case method in ASP.NET MVC

How to create a new test case method in Unit test project?

To create a new Test case method, create a new method in the Unit test class and decorate with [TestMethod].
TEST CLASS CODE
using System;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace WebApplicationTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {

        }

        [TestMethod]
        public void CreateViewTest()
        {

        }
    }
}
See the highlighted code that has a method with [TestMethod] attribute.

No comments:

Post a Comment

How to register multiple implementations of the same interface in Asp.Net Core?

 Problem: I have services that are derived from the same interface. public interface IService { } public class ServiceA : IService { ...