From 97dc949e3f0bdd0eb79da68750f02f3699ab8feb Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Thu, 29 Nov 2018 17:38:51 +1000 Subject: [PATCH] Fix some more C# unit test issues. Ignore bin and obj directories under /csharp --- .gitignore | 2 ++ csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a73fe987ba3c1..dd44eb6d846c1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ onnxruntime_profile*.json /docs/python/examples/*.onnx /docs/python/examples/graph.* /docs/python/*_LICENSE +/csharp/**/obj/ +/csharp/**/bin/ diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs b/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs index 3b25d16e9dbd4..e185cb6796cec 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs @@ -113,8 +113,8 @@ private void ThrowWrongInputName() var container = new List(); container.Add(NamedOnnxValue.CreateFromTensor("wrong_name", tensor)); var ex = Assert.Throws(() => session.Run(container)); - Assert.Equal("[ErrorCode:InvalidArgument] Missing required inputs: data_0 ", ex.Message); - session.Dispose(); + Assert.Equal("[ErrorCode:InvalidArgument] Missing required inputs: data_0", ex.Message); + session.Dispose(); } [Fact] @@ -179,7 +179,7 @@ private void ThrowExtraInputs() container.Add(nov1); container.Add(nov2); var ex = Assert.Throws(() => session.Run(container)); - Assert.Equal("[ErrorCode:InvalidArgument] Invalid Feed Input Names: extra. Valid input names are: data_0 ", ex.Message); + Assert.StartsWith("[ErrorCode:InvalidArgument] Invalid Feed Input Names: extra. Valid input names are: ", ex.Message); session.Dispose(); }