Unit testing does not show test result

I created one Unit Test project where I am testing my view, but it does not show any result. Below is my code: -

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SinglePage.Controllers;
using System.Web.Mvc;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            Console.WriteLine("METHOD");
            //Arrange
            HomeController ctrl = new HomeController();

            Console.WriteLine("Pass");
            //Act
            ViewResult r = ctrl.Index() as ViewResult;

            //Asert
            Assert.AreEqual("View1", r.ViewName);
        }

    }
}

After clicking the Run All button from Test Explorer, I get the message below:

------ Start test started ------

No plugin was found that can import the settings file with the extension '.csproj. Either select a new settings file or install an extension that understands this extension of the settings file.

========== Open the test: 0 found (0: 00: 00.0010010094) ==========

+4
source share
1 answer

The user Debug.WriteLinecan use to print the tab "Output" in Visual Studio.

[TestMethod]
public void TestMethod1()
{
    Debug.WriteLine("METHOD");
    //Arrange
    HomeController ctrl = new HomeController();

    Debug.WriteLine("Pass");
    //Act
    ViewResult r = ctrl.Index() as ViewResult;

    //Asert
    Assert.AreEqual("View1", r.ViewName);
}
0
source

All Articles