diff --git a/examples/tests/SatSolverTests.cs b/examples/tests/SatSolverTests.cs index d4f39a192d..2020183828 100644 --- a/examples/tests/SatSolverTests.cs +++ b/examples/tests/SatSolverTests.cs @@ -442,10 +442,9 @@ namespace Google.OrTools.Tests CpModel model = new CpModel(); IntVar v = model.NewIntVar(-10, 10, "v"); IntervalVar i = model.NewFixedSizeIntervalVar(v, 3, "i"); - Console.WriteLine("Start = " + i.StartExpr().ToString() + "/" + i.StartExpr().ShortString()); - Console.WriteLine("Size = " + i.SizeExpr().ToString() + "/" + i.SizeExpr().ShortString()); - Console.WriteLine("End = " + i.EndExpr().ToString() + "/" + i.EndExpr().ShortString()); - Console.WriteLine("Interval = " + i.ToString()); + Assert.Equal("v", i.StartExpr().ShortString()); + Assert.Equal("3", i.SizeExpr().ShortString()); + Assert.Equal("(v + 3)", i.EndExpr().ShortString()); } } } // namespace Google.OrTools.Tests diff --git a/ortools/sat/csharp/IntegerExpressions.cs b/ortools/sat/csharp/IntegerExpressions.cs index 2b199393be..f589b69098 100644 --- a/ortools/sat/csharp/IntegerExpressions.cs +++ b/ortools/sat/csharp/IntegerExpressions.cs @@ -379,7 +379,7 @@ namespace Google.OrTools.Sat long offset = proto.Offset; if (numElements == 0) { - return new ConstantExpr(offset); + return LinearExpr.Constant(offset); } else if (numElements == 1)