Files
ortools-clone/cmake/samples/dotnet/SATSample.cs
Mizux Seiha e83cf08ce1 ci: Refactor CMake CI
* Update CMake doc
* Update Docker diagram
* Refactor CI Makefile
* Refactor and Fix <lang>.Dockerfile
* Refactor gh Docker CMake workflow
* gh CMake workflow disable fail-fast
* Remove manylinux
* Add Java samplei, generated using:
    $ mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart
    -> com.google.ortools
    -> sample
  note: sample still not use ortools package yet
2020-04-15 15:22:41 +02:00

29 lines
664 B
C#

using System;
using Xunit;
using Google.OrTools.Sat;
namespace Google.OrTools.Tests {
public class SatSolverTest {
[Theory]
[InlineData(false)]
[InlineData(true)]
public void SolverTest(bool callGC) {
CpModel model = new CpModel();
int num_vals = 3;
IntVar x = model.NewIntVar(0, num_vals - 1, "x");
IntVar y = model.NewIntVar(0, num_vals - 1, "y");
IntVar z = model.NewIntVar(0, num_vals - 1, "z");
model.Add(x != y);
CpSolver solver = new CpSolver();
if (callGC) {
GC.Collect();
}
CpSolverStatus status = solver.Solve(model);
}
}
} // namespace Google.Sample.Tests