Unit testing and Solver Foundation

279 Views Asked by At

I'm currently working on a large scale business application and I'm going to use Solver Foundation with Solver Foundation Services to solve a huge portfolio optimization problem with user defined constraints and input. The problem will usually be around 5-10 000 variables and a couple of thousand constraints.

I've started the development using SFS, but I'm having serious trouble unit testing my code. I want to test that the problem I've set up is correct, that all constraints have the correct input and that all parameters are set up correct. But to do that i need to write unit tests againts the SolverContext, and more spesifically, the Parameter objects and the Constraint objects. And these classes are completely sealed up. I can't seem to get any information out of them except their name, expression and index sets.

Is there any way to test the value of a parameter for a given index?

I.e.

var value = myParameter.GetValueFor(anObjectsID);
Assert.That(value, Is.EqualTo(expectedValue);

I can't seem to find any documentation or articles concerning Solver Foundation and unit testing.

Any ideas or comments?

Julian

0

There are 0 best solutions below