I have two projects, BasicCalculator
and BasicCalculator.Test.Unit
. I am wanting to test classes with certain functions from the BasicCalculator
project. I created a unit test file named BasicCalculator.Test.Unit
and added a new reference (BasicCalculator
) inside of that project.
using System;
using BasicCalculator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace BasicCalculator.Test.Unit
{
[TestClass]
public class CalculatorEngineTest
{
private readonly CalculatorEngine _calculatorEngine = new CalculatorEngine();
[TestMethod]
public void TestMethod1()
{
}
}
}
However, whenever I type private readonly CalculatorEngine _calculatorEngine = new CalculatorEngine();
it displays an error for CalculatorEngine
which is a class in the BasicCalculator project.
It says:
class BasicCalculator.CalculatorEngine
BasicCalculator - Available
BasicCalculator.Test.Unit - Not Available
You can use the navigation bar to switch context.
The type or namespace 'CalculatorEngine' could not be found (are you missing a using directive or an assembly reference?)
Am not sure why this is occurring if I just needed to add a reference in the BasicCalculator.Test.Unit project that calls the BasicCalculator project.
ADDED INFORMATION
This is my class that I am trying to access inside of BasicCalculator.Test.Unit
using System;
using System.Collections.Generic;
using System.Text;
namespace BasicCalculator
{
public class CalculatorEngine
{
public double Calculate(string argOperation, double argFirstNumber, double argSecondNumber)
{
}
}
}