jeudi 2 juillet 2020

Vector CANoe - How do you build a .NET tests node with multiple C# files?

Objectives
I want to use the Vector CANoe C# (.NET) scripting capability.
More specifically, I want to reduce my .NET test nodes' complexity by building some core utility classes.

For example, instead of having this

// With the Vector API directly
IVT2516Channel M4_Ch9 = vts.GetChannel("M4_Ch9");
M4_Ch9.DigitalOutput.Value = true;

An object could do this:

// With an Object that abstract the Vector API
MyECU ecu = utilities.MyECU();
ecu.OpenContactor(True);

To achieve this, my plan was to build a utilities.cs file that every .NET tests module would use.
The idea is roughly this:

+---------------------------+
| Test environement         |
|                           |
|   +--------+ +--------+   |
|   |  .NET  | |  .NET  |   |
|   |  test  | |  test  |   |
|   | module | | module |   |
|   +--------+ +--------+   |
|        |         |        |
+--------|---------|--------+
         |         |
+--------v---------v--------+
|                           |
|       CORE UTILITES       |
|                           |
+---------------------------+
             |
+------------v--------------+
|                           |
|       VECTOR Modules      |
|                           |
+---------------------------+

Problem
I can't get the compiler happy. I always get error CS0246:

System  Testmodule 'Test 1': Compilation of tests_wakeup.cs' failed with error(s)
System  tests_wakeup.cs(17,7): error CS0246: The type or namespace name 'utilities' could not be found (are you missing a using directive or an assembly reference?)

When using the Visual studio, my solution build without problems.

Question
How do you build a .NET tests node with multiple C# files?

Aucun commentaire:

Enregistrer un commentaire