diff --git a/LibSVMSharp.Tests/Contants.cs b/LibSVMSharp.Tests/Contants.cs index cd0e6ac..5ab3cc7 100644 --- a/LibSVMSharp.Tests/Contants.cs +++ b/LibSVMSharp.Tests/Contants.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace LibSVMSharp.Tests +namespace LibSVMSharp.Tests { public static class Contants { diff --git a/LibSVMSharp.Tests/Extensions/TestSVMProblemExtensions.cs b/LibSVMSharp.Tests/Extensions/TestSVMProblemExtensions.cs index 2487cca..2356ef2 100644 --- a/LibSVMSharp.Tests/Extensions/TestSVMProblemExtensions.cs +++ b/LibSVMSharp.Tests/Extensions/TestSVMProblemExtensions.cs @@ -1,12 +1,11 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; namespace LibSVMSharp.Tests.Extensions { - [TestClass] + [TestFixture] public class TestSVMProblemExtensions { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMSharp.Tests/Helpers/TestSVMHelper.cs b/LibSVMSharp.Tests/Helpers/TestSVMHelper.cs index 24424ed..1b38605 100644 --- a/LibSVMSharp.Tests/Helpers/TestSVMHelper.cs +++ b/LibSVMSharp.Tests/Helpers/TestSVMHelper.cs @@ -1,12 +1,11 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; namespace LibSVMSharp.Tests.Helpers { - [TestClass] + [TestFixture] public class TestSVMHelper { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMSharp.Tests/Helpers/TestSVMNodeHelper.cs b/LibSVMSharp.Tests/Helpers/TestSVMNodeHelper.cs index f88939f..fbfc3fb 100644 --- a/LibSVMSharp.Tests/Helpers/TestSVMNodeHelper.cs +++ b/LibSVMSharp.Tests/Helpers/TestSVMNodeHelper.cs @@ -1,12 +1,11 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; namespace LibSVMSharp.Tests.Helpers { - [TestClass] + [TestFixture] public class TestSVMNodeHelper { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMSharp.Tests/Helpers/TestSVMProblemHelper.cs b/LibSVMSharp.Tests/Helpers/TestSVMProblemHelper.cs index 9644cb6..b50f897 100644 --- a/LibSVMSharp.Tests/Helpers/TestSVMProblemHelper.cs +++ b/LibSVMSharp.Tests/Helpers/TestSVMProblemHelper.cs @@ -1,12 +1,11 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; namespace LibSVMSharp.Tests.Helpers { - [TestClass] + [TestFixture] public class TestSVMProblemHelper { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMSharp.Tests/LibSVMSharp.Tests.csproj b/LibSVMSharp.Tests/LibSVMSharp.Tests.csproj index c034656..1b707ac 100644 --- a/LibSVMSharp.Tests/LibSVMSharp.Tests.csproj +++ b/LibSVMSharp.Tests/LibSVMSharp.Tests.csproj @@ -1,101 +1,21 @@ - - - - Debug - AnyCPU - {2DE0BD3C-C37B-4B23-9533-2F91C1DD15C3} - Library - Properties - LibSVMSharp.Tests - LibSVMSharp.Tests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x64 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - x64 - + + + net5.0 + Exe + ..\ + true + false + x64 + - + - - - - - - - - - - - - - - - - - - - - - - - + + - - {ac04337c-e542-4be9-8dbd-5b44535299e2} - LibSVMsharp - + + - - - - - - False - - - False - - - False - - - False - - - - - - - \ No newline at end of file diff --git a/LibSVMSharp.Tests/TestSVM.cs b/LibSVMSharp.Tests/TestSVM.cs index b5f21ff..fc589e2 100644 --- a/LibSVMSharp.Tests/TestSVM.cs +++ b/LibSVMSharp.Tests/TestSVM.cs @@ -1,23 +1,22 @@ using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; using LibSVMsharp; +using NUnit.Framework; namespace LibSVMSharp.Tests { - [TestClass] + [TestFixture] public class TestSVM { - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_Train_ProblemIsNull_ThrowsException() { - SVM.Train(null, new SVMParameter()); + Assert.Throws(()=> SVM.Train(null, new SVMParameter())); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + + [Test] public void SVM_Train_ParameterIsNull_ThrowsException() { - SVM.Train(new SVMProblem(), null); + Assert.Throws(() => SVM.Train(new SVMProblem(), null)); } //[TestMethod] public void SVM_Train_Correct() @@ -25,26 +24,23 @@ public void SVM_Train_Correct() } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_CrossValidation_ProblemIsNull_ThrowsException() { double[] target; - SVM.CrossValidation(null, new SVMParameter(), 5, out target); + Assert.Throws(() => SVM.CrossValidation(null, new SVMParameter(), 5, out target)); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_CrossValidation_ParameterIsNull_ThrowsException() { double[] target; - SVM.CrossValidation(new SVMProblem(), null, 5, out target); + Assert.Throws(() => SVM.CrossValidation(new SVMProblem(), null, 5, out target)); } - [TestMethod] - [ExpectedException(typeof(ArgumentOutOfRangeException))] + [Test] public void SVM_CrossValidation_FoldNumberIsOutOfRange_ThrowsException() { double[] target; - SVM.CrossValidation(new SVMProblem(), new SVMParameter(), 1, out target); + Assert.Throws(() => SVM.CrossValidation(new SVMProblem(), new SVMParameter(), 1, out target)); } //[TestMethod] public void SVM_CrossValidation_Correct() @@ -52,14 +48,14 @@ public void SVM_CrossValidation_Correct() } - [TestMethod] + [Test] public void SVM_SaveModel_ModelIsNull_ReturnsFalse() { bool success = SVM.SaveModel(null, Contants.CORRECT_MODEL_PATH_TO_BE_SAVED); Assert.IsFalse(success); } - [TestMethod] + [Test] public void SVM_SaveModel_FilenameIsInvalid_ReturnsFalse() { bool success = SVM.SaveModel(new SVMModel(), ""); @@ -72,12 +68,12 @@ public void SVM_SaveModel_Correct() } - [TestMethod] + [Test] public void SVM_LoadModel_FilenameIsInvalid_ReturnsNull() { SVM.LoadModel(""); } - [TestMethod] + [Test] public void SVM_LoadModel_FilenameDoesNotExist_ReturnsNull() { SVM.LoadModel(Contants.WRONG_MODEL_PATH_TO_BE_LOADED); @@ -93,26 +89,23 @@ public void SVM_LoadModel_Correct() } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_PredictValues_ModelIsNull_ThrowsException() { double[] values; - SVM.PredictValues(null, new SVMNode[5], out values); + Assert.Throws(() => SVM.PredictValues(null, new SVMNode[5], out values)); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_PredictValues_ModelIsZero_ThrowsException() { double[] values; - SVM.PredictValues(IntPtr.Zero, new SVMNode[5], out values); + Assert.Throws(() => SVM.PredictValues(IntPtr.Zero, new SVMNode[5], out values)); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_PredictValues_InputVectorIsNull_ThrowsException() { double[] values; - SVM.PredictValues(new SVMModel(), null, out values); + Assert.Throws(() => SVM.PredictValues(new SVMModel(), null, out values)); } //[TestMethod] public void SVM_PredictValues_Correct() @@ -120,23 +113,20 @@ public void SVM_PredictValues_Correct() } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_Predict_ModelIsNull_ThrowsException() { - SVM.Predict(null, new SVMNode[5]); + Assert.Throws(() => SVM.Predict(null, new SVMNode[5])); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_Predict_ModelIsZero_ThrowsException() { - SVM.Predict(IntPtr.Zero, new SVMNode[5]); + Assert.Throws(() => SVM.Predict(IntPtr.Zero, new SVMNode[5])); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_Predict_InputVectorIsNull_ThrowsException() { - SVM.Predict(new SVMModel(), null); + Assert.Throws(() => SVM.Predict(new SVMModel(), null)); } //[TestMethod] public void SVM_Predict_Correct() @@ -144,26 +134,23 @@ public void SVM_Predict_Correct() } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_PredictProbability_ModelIsNull_ThrowsException() { double[] values; - SVM.PredictProbability(null, new SVMNode[5], out values); + Assert.Throws(() => SVM.PredictProbability(null, new SVMNode[5], out values)); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_PredictProbability_ModelIsZero_ThrowsException() { double[] values; - SVM.PredictProbability(IntPtr.Zero, new SVMNode[5], out values); + Assert.Throws(() => SVM.PredictProbability(IntPtr.Zero, new SVMNode[5], out values)); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_PredictProbability_InputVectorIsNull_ThrowsException() { double[] values; - SVM.PredictProbability(new SVMModel(), null, out values); + Assert.Throws(() => SVM.PredictProbability(new SVMModel(), null, out values)); } //[TestMethod] public void SVM_PredictProbability_NotProbabilityModel_ReturnsNegativeNumber() @@ -176,17 +163,15 @@ public void SVM_PredictProbability_Correct() } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_CheckParameter_ProblemIsNull_ThrowsException() { - SVM.CheckParameter(null, new SVMParameter()); + Assert.Throws(() => SVM.CheckParameter(null, new SVMParameter())); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_CheckParameter_ParameterIsNull_ThrowsException() { - SVM.CheckParameter(new SVMProblem(), null); + Assert.Throws(() => SVM.CheckParameter(new SVMProblem(), null)); } //[TestMethod] public void SVM_CheckParameter_Correct() @@ -194,11 +179,10 @@ public void SVM_CheckParameter_Correct() } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Test] public void SVM_CheckProbabilityModel_ModelIsNull_ThrowsException() { - SVM.CheckProbabilityModel(null); + Assert.Throws(() => SVM.CheckProbabilityModel(null)); } //[TestMethod] public void SVM_CheckProbabilityModel_Correct() diff --git a/LibSVMSharp.Tests/TestSVMModel.cs b/LibSVMSharp.Tests/TestSVMModel.cs index 82f39ed..6197fa1 100644 --- a/LibSVMSharp.Tests/TestSVMModel.cs +++ b/LibSVMSharp.Tests/TestSVMModel.cs @@ -1,12 +1,12 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; + +using NUnit.Framework; namespace LibSVMSharp.Tests { - [TestClass] + [TestFixture] public class TestSVMModel { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMSharp.Tests/TestSVMNode.cs b/LibSVMSharp.Tests/TestSVMNode.cs index d77441c..5ccb96d 100644 --- a/LibSVMSharp.Tests/TestSVMNode.cs +++ b/LibSVMSharp.Tests/TestSVMNode.cs @@ -1,12 +1,11 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; namespace LibSVMSharp.Tests { - [TestClass] + [TestFixture] public class TestSVMNode { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMSharp.Tests/TestSVMParameter.cs b/LibSVMSharp.Tests/TestSVMParameter.cs index 3aee3f8..6f00ef5 100644 --- a/LibSVMSharp.Tests/TestSVMParameter.cs +++ b/LibSVMSharp.Tests/TestSVMParameter.cs @@ -1,12 +1,11 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; namespace LibSVMSharp.Tests { - [TestClass] + [TestFixture] public class TestSVMParameter { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMSharp.Tests/TestSVMProblem.cs b/LibSVMSharp.Tests/TestSVMProblem.cs index bcb409f..9564a9a 100644 --- a/LibSVMSharp.Tests/TestSVMProblem.cs +++ b/LibSVMSharp.Tests/TestSVMProblem.cs @@ -1,12 +1,11 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; namespace LibSVMSharp.Tests { - [TestClass] + [TestFixture] public class TestSVMProblem { - [TestMethod] + [Test] public void TestMethod1() { } diff --git a/LibSVMsharp.Examples.Classification/LibSVMsharp.Examples.Classification.csproj b/LibSVMsharp.Examples.Classification/LibSVMsharp.Examples.Classification.csproj index f833616..dc43738 100644 --- a/LibSVMsharp.Examples.Classification/LibSVMsharp.Examples.Classification.csproj +++ b/LibSVMsharp.Examples.Classification/LibSVMsharp.Examples.Classification.csproj @@ -1,62 +1,15 @@ - - - + - Debug - AnyCPU - {40F859AD-241A-4379-831C-8FB69BE6A8B1} + net5.0 Exe - Properties - LibSVMsharp.Examples.Classification - LibSVMsharp.Examples.Classification - v4.5 - 512 ..\ true - - - x64 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - + false x64 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - {ac04337c-e542-4be9-8dbd-5b44535299e2} - LibSVMsharp - + - Always @@ -65,18 +18,5 @@ Always - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/LibSVMsharp.Examples.RapidPrediction/LibSVMsharp.Examples.RapidPrediction.csproj b/LibSVMsharp.Examples.RapidPrediction/LibSVMsharp.Examples.RapidPrediction.csproj index 54a795e..dc43738 100644 --- a/LibSVMsharp.Examples.RapidPrediction/LibSVMsharp.Examples.RapidPrediction.csproj +++ b/LibSVMsharp.Examples.RapidPrediction/LibSVMsharp.Examples.RapidPrediction.csproj @@ -1,63 +1,15 @@ - - - + - Debug - AnyCPU - {FFDF7EA5-53DA-4DF7-9DD8-E4E7DE2B5AB6} + net5.0 Exe - Properties - LibSVMsharp.Examples.RapidPrediction - LibSVMsharp.Examples.RapidPrediction - v4.5 - 512 ..\ true - - - x64 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - + false x64 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - {ac04337c-e542-4be9-8dbd-5b44535299e2} - LibSVMsharp - + - Always @@ -66,18 +18,5 @@ Always - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/LibSVMsharp/LibSVMsharp.csproj b/LibSVMsharp/LibSVMsharp.csproj index ad1498f..8bb7ce4 100644 --- a/LibSVMsharp/LibSVMsharp.csproj +++ b/LibSVMsharp/LibSVMsharp.csproj @@ -1,66 +1,12 @@ - - - + - Debug - AnyCPU - {AC04337C-E542-4BE9-8DBD-5B44535299E2} + netstandard2.0 Library - Properties - LibSVMsharp - LibSVMsharp - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x64 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Always @@ -69,16 +15,9 @@ Always - - - - - - + + + + + \ No newline at end of file