Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Classes not recognized in their unit test code

$
0
0
I have a C# class library, which I'll call "MyLibrary," for which I have made a unit test project, which I will call "MyLibrary.Test." MyLibrary contains several class definitions. Currently, all of these references are broken. Specifically, they are marked with the error "The type or namespace name 'MyClass' could not be found (are you missing a using directive or an assembly reference?)." Both the using directive and the assembly reference are present, like so:

using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MyLibrary;

namespace MyLibrary.Test
{
    /// <summary>
    /// Test class for MyLibrary.MyClass.
    /// </summary>
    [TestClass()]
    public class MyClassTest
    {

        private TestContext testContextInstance;
        public TestContext TestContext [...]

        internal virtual MyClass CreateMyClass()
        {
            [...]
        }

What is the problem and how do I resolve it?

Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>