lundi 28 septembre 2015

how to call a method from class in seperate project

I have a class library project and have added to that another project which is a unit test project. In the class library project I have the following code:

public class NumberManipulator
{
public int FindMax(int num1, int num2)
{
int result;

if (num1 > num2)

result = num1;

else
result = num2;

return result;
}
}

A simple bit of code to return the highest number out of two inputs. In my unit test project I am trying to call the FindMax method using the following:

NumberManipulator test = new NumberManipulator();

but the class is not recognised and giving the following message "The type or namespace name 'NumberManipulator' could not be found (are you missing a using directive or an assembly reference?)"

I have referenced the class project in the unit test project, not sure why I'm not able to call that class though.

Aucun commentaire:

Enregistrer un commentaire