diff --git a/examples/tests/issue18.cs b/examples/tests/issue18.cs index fea2ef2359..7271d89df7 100644 --- a/examples/tests/issue18.cs +++ b/examples/tests/issue18.cs @@ -12,16 +12,12 @@ // limitations under the License. using System; -using Xunit; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; -namespace Google.OrTools.Tests +public class Issue18 { -public class Issue18Test -{ - [Fact] - public void NewSearchTest() + public static void NewSearchTest() { Solver solver = new Google.OrTools.ConstraintSolver.Solver("p"); @@ -52,5 +48,8 @@ public class Issue18Test } Console.WriteLine("Solutions: " + count); } + static void Main() + { + NewSearchTest(); + } } -} // namespace Google.OrTools.Tests diff --git a/examples/tests/issue22.cs b/examples/tests/issue22.cs index e4fedb747a..04794491e0 100644 --- a/examples/tests/issue22.cs +++ b/examples/tests/issue22.cs @@ -16,14 +16,11 @@ using System.Collections; using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; -using Xunit; using Google.OrTools.ConstraintSolver; -namespace Google.OrTools.Tests -{ public class Issue22Test { - private long Solve(long num_buses_check = 0) + private static long Solve(long num_buses_check = 0) { ConstraintSolverParameters sPrm = Solver.DefaultSolverParameters(); sPrm.CompressTrail = 0; @@ -72,13 +69,16 @@ public class Issue22Test return 1; } - [Fact] - public void InitialPropagateTest() + public static void InitialPropagateTest() { Console.WriteLine("Check for minimum number of buses: "); long num_buses = Solve(); Console.WriteLine("\n... got {0} as minimal value.", num_buses); Console.WriteLine("\nAll solutions: ", num_buses); } + + static void Main() + { + InitialPropagateTest(); + } } -} // namespace Google.OrTools.Tests diff --git a/examples/tests/issue33.cs b/examples/tests/issue33.cs index dad4f67771..d73db7b751 100644 --- a/examples/tests/issue33.cs +++ b/examples/tests/issue33.cs @@ -20,10 +20,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System; -using Xunit; -namespace Google.OrTools.Test -{ public class Task { public int Id { get; private set; } @@ -665,13 +662,15 @@ public class FactoryScheduling } } -public class Issue18Test +public class Issue33Test { - [Fact] - public void FactorySchedulingTest() + public static void FactorySchedulingTest() { FactoryScheduling scheduling = new FactoryScheduling(new SmallSyntheticData().FetchData()); scheduling.Solve(); } + static void Main() + { + FactorySchedulingTest(); + } } -} // namespace Google.OrTools.Test diff --git a/makefiles/Makefile.dotnet.mk b/makefiles/Makefile.dotnet.mk index e207020aa5..75583e3787 100644 --- a/makefiles/Makefile.dotnet.mk +++ b/makefiles/Makefile.dotnet.mk @@ -226,7 +226,7 @@ endif cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" clean -c Release -v minimal endef -DOTNET_EXAMPLES := contrib dotnet +DOTNET_EXAMPLES := contrib dotnet tests $(foreach example,$(DOTNET_EXAMPLES),$(eval $(call dotnet-example-target,$(example)))) # Tests @@ -390,16 +390,16 @@ check_dotnet: \ test_dotnet_linear_solver_samples \ test_dotnet_sat_samples \ -.PHONY: test_dotnet_tests # Build and Run all .Net Tests (located in examples/test) +.PHONY: test_dotnet_tests # Build and Run all .Net Tests (located in examples/test and ortools//csharp) test_dotnet_tests: \ rdotnet_InitTests \ rdotnet_LinearSolverTests \ rdotnet_ConstraintSolverTests \ rdotnet_RoutingSolverTests \ rdotnet_SatSolverTests \ -# rdotnet_issue18 \ -# rdotnet_issue22 \ -# rdotnet_issue33 + rdotnet_issue18 \ + rdotnet_issue22 \ + rdotnet_issue33 .PHONY: test_dotnet_contrib # Build and Run all .Net Examples (located in examples/contrib) test_dotnet_contrib: \