From 0bcf4e516dae8783244335ea773c51f01b9eeca0 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 24 May 2019 16:39:19 +0200 Subject: [PATCH] Aggiutna altre classi di testing... --- MCC_UnitTest/MCC_UnitTest.csproj | 17 +++++++++++++++++ MCC_UnitTest/TestSuite.cs | 28 +++++++++++++++++++++++++++- MCC_UnitTest/app.config | 8 ++++++++ MCC_UnitTest/packages.config | 3 +++ MConnectSDK/Logging.cs | 15 --------------- MConnectSDK/MConnectClient.cs | 1 - TestClient/App.config | 4 ++++ TestClient/TestClient.csproj | 4 ++-- TestClient/packages.config | 2 +- 9 files changed, 62 insertions(+), 20 deletions(-) diff --git a/MCC_UnitTest/MCC_UnitTest.csproj b/MCC_UnitTest/MCC_UnitTest.csproj index 9d707b5..fb078b1 100644 --- a/MCC_UnitTest/MCC_UnitTest.csproj +++ b/MCC_UnitTest/MCC_UnitTest.csproj @@ -39,17 +39,27 @@ 4 + ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + ..\packages\NLog.4.6.3\lib\net45\NLog.dll + ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + + + + + ..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll @@ -60,6 +70,13 @@ ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + + ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + + + diff --git a/MCC_UnitTest/TestSuite.cs b/MCC_UnitTest/TestSuite.cs index 64122cf..ff0ead7 100644 --- a/MCC_UnitTest/TestSuite.cs +++ b/MCC_UnitTest/TestSuite.cs @@ -126,7 +126,7 @@ namespace MCC_UnitTest #endregion [TestMethod] - public void Test_init_01() + public void Test_setup_01() { // reset x iniziare... if (_cts != null) @@ -143,6 +143,32 @@ namespace MCC_UnitTest //// init async... //var taskResult = MCC.InitSDKAsync(confFilePath, CancellationToken.None); + //// salvo il risultato restituito... + //reqStatus = taskResult.Result; + + //// test! + //Assert.IsNotNull(reqStatus); + } + + [TestMethod] + public void Test_init_01() + { + // reset x iniziare... + if (_cts != null) + { + _cts.Cancel(); + } + + // NUOVA istanza da file di conf... + MCC = new MConnectClient(); + + // init async... + var taskResult = MCC.InitSDKAsync(confFilePath, CancellationToken.None); + + // test! + Assert.IsNotNull(taskResult.Result); + + //// salvo il risultato restituito... //reqStatus = taskResult.Result; diff --git a/MCC_UnitTest/app.config b/MCC_UnitTest/app.config index bfa578d..76219ab 100644 --- a/MCC_UnitTest/app.config +++ b/MCC_UnitTest/app.config @@ -14,6 +14,14 @@ + + + + + + + + \ No newline at end of file diff --git a/MCC_UnitTest/packages.config b/MCC_UnitTest/packages.config index 27d23b1..515e7ff 100644 --- a/MCC_UnitTest/packages.config +++ b/MCC_UnitTest/packages.config @@ -2,8 +2,11 @@ + + + \ No newline at end of file diff --git a/MConnectSDK/Logging.cs b/MConnectSDK/Logging.cs index 1d6d76d..ceb3f8c 100644 --- a/MConnectSDK/Logging.cs +++ b/MConnectSDK/Logging.cs @@ -9,22 +9,7 @@ namespace MConnectSDK public static Logger Instance { get; private set; } static Log() { -#if DEBUG - // Setup the logging view for Sentinel - http://sentinel.codeplex.com - var sentinalTarget = new NLogViewerTarget() - { - Name = "sentinal", - Address = "udp://127.0.0.1:9999", - IncludeNLogData = false - }; - var sentinalRule = new LoggingRule("*", LogLevel.Trace, sentinalTarget); - LogManager.Configuration.AddTarget("sentinal", sentinalTarget); - LogManager.Configuration.LoggingRules.Add(sentinalRule); - -#endif - LogManager.ReconfigExistingLoggers(); - Instance = LogManager.GetCurrentClassLogger(); } } diff --git a/MConnectSDK/MConnectClient.cs b/MConnectSDK/MConnectClient.cs index d315900..807cc97 100644 --- a/MConnectSDK/MConnectClient.cs +++ b/MConnectSDK/MConnectClient.cs @@ -617,7 +617,6 @@ namespace MConnectSDK /// public MConnectClient() { - confParam param = new confParam(); ML = new memLayer(param); } diff --git a/TestClient/App.config b/TestClient/App.config index d2ca4f4..709643e 100644 --- a/TestClient/App.config +++ b/TestClient/App.config @@ -23,6 +23,10 @@ + + + + \ No newline at end of file diff --git a/TestClient/TestClient.csproj b/TestClient/TestClient.csproj index a1bf885..374c448 100644 --- a/TestClient/TestClient.csproj +++ b/TestClient/TestClient.csproj @@ -84,8 +84,8 @@ ..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.5.2\lib\netstandard2.0\System.Memory.dll + + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll diff --git a/TestClient/packages.config b/TestClient/packages.config index 8ce05d8..8637875 100644 --- a/TestClient/packages.config +++ b/TestClient/packages.config @@ -11,7 +11,7 @@ - +