IGNITE-7002 .NET: Add cross-platform examples on .NET Core
authorPavel Tupitsyn <ptupitsyn@apache.org>
Tue, 5 Dec 2017 11:18:57 +0000 (14:18 +0300)
committerPavel Tupitsyn <ptupitsyn@apache.org>
Tue, 5 Dec 2017 11:18:57 +0000 (14:18 +0300)
(missed changes)

This closes #3119

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/Example.cs
modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs

index 4d1eeb6..de43666 100644 (file)
@@ -73,7 +73,8 @@ namespace Apache.Ignite.Core.Tests.Examples
         {
             var examplesAsm = typeof (ClosureExample).Assembly;
 
-            var sourceFiles = Directory.GetFiles(PathUtil.ExamplesSourcePath, "*.cs", SearchOption.AllDirectories);
+            var sourceFiles = Directory.GetFiles(PathUtil.ExamplesSourcePath, "*.cs", SearchOption.AllDirectories)
+                .Where(x => !x.Contains("dotnetcore")).ToArray();
 
             Assert.IsTrue(sourceFiles.Any());
 
@@ -102,7 +103,9 @@ namespace Apache.Ignite.Core.Tests.Examples
         /// </summary>
         private static Action GetRunAction(Type type)
         {
-            return (Action) Delegate.CreateDelegate(typeof (Action), type.GetMethod("Main"));
+            var mainMethod = type.GetMethod("Main");
+            Assert.IsNotNull(mainMethod);
+            return (Action) Delegate.CreateDelegate(typeof (Action), mainMethod);
         }
 
         /// <summary>
index 5415378..513ec0c 100644 (file)
@@ -37,7 +37,7 @@ namespace Apache.Ignite.Core.Tests
         public void TestCsprojToolsVersion()
         {
             var projFiles = GetDotNetSourceDir().GetFiles("*.csproj", SearchOption.AllDirectories)
-                .Where(x => !x.Name.Contains("DotNetCore")).ToArray();
+                .Where(x => !x.FullName.ToLower().Contains("dotnetcore")).ToArray();
             
             Assert.GreaterOrEqual(projFiles.Length, 7);
             CheckFiles(projFiles, x => !x.Contains("ToolsVersion=\"4.0\""), "Invalid csproj files: ");