You need to go to the project properties you compile and :
define your TEST inside that field. The field is Conditional compilation symbols.
Question
Under one Solution two projects, one Main, second UnitTestMain.
From project UnitTestMain need to call a method and pass somehow #define TEST
to be processed.
Project UnitTestMain:
#define TEST
using System;
namespace UnitTest
{
[TestClass]
public class UnitTest
{
private Calculate calc = new Calculate();
[TestMethod]
public void Test()
{
calc.test());
}
}
}
Project Main
public bool test()
{
bool ok;
#if TEST
ok = true;
#else
ok = false;
#endif
}
Method test return: false. But need true.
Solution
You need to go to the project properties you compile and :
define your TEST inside that field. The field is Conditional compilation symbols.