diff --git a/.gitignore b/.gitignore index a6989da..90c7cfa 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ /.vs/EDSTest/v14/*.suo /.vs/EDSEditor/v14/*.suo edseditor-Setup.exe +/Tests/bin/Debug +/Tests/obj/Debug diff --git a/EDSEditor.sln b/EDSEditor.sln index 6d680bf..4b17fdb 100644 --- a/EDSEditor.sln +++ b/EDSEditor.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EDSEditorGUI", "EDSTest\EDS EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libEDSsharp", "libEDSsharp\libEDSsharp.csproj", "{CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{2A479BF3-7628-409B-8A29-9314C308445E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}.Release|Any CPU.Build.0 = Release|Any CPU + {2A479BF3-7628-409B-8A29-9314C308445E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A479BF3-7628-409B-8A29-9314C308445E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A479BF3-7628-409B-8A29-9314C308445E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A479BF3-7628-409B-8A29-9314C308445E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/ExporterTests.cs b/Tests/ExporterTests.cs new file mode 100644 index 0000000..c0007f2 --- /dev/null +++ b/Tests/ExporterTests.cs @@ -0,0 +1,25 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using libEDSsharp; + +namespace Tests +{ + [TestClass] + public class ExporterTests : CanOpenNodeExporter + { + [TestMethod] + public void Test_cname_conversion() + { + + if (make_cname("axle 0 wheel right controlword") != "axle0WheelRightControlword") + throw (new Exception("make_cname Conversion error")); + + if (make_cname("mapped object 4") != "mappedObject4") + throw (new Exception("make_cname Conversion error")); + + if (make_cname("COB ID used by RPDO") != "COB_IDUsedByRPDO") + throw (new Exception("make_cname Conversion error")); + + } + } +} diff --git a/Tests/Properties/AssemblyInfo.cs b/Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..39f19be --- /dev/null +++ b/Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tests")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2a479bf3-7628-409b-8a29-9314c308445e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj new file mode 100644 index 0000000..b8d3198 --- /dev/null +++ b/Tests/Tests.csproj @@ -0,0 +1,89 @@ + + + + Debug + AnyCPU + {2A479BF3-7628-409B-8A29-9314C308445E} + Library + Properties + Tests + Tests + v4.5.2 + 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 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + {cc0fa4b1-2bfc-43b3-8c56-b428df2d24e7} + libEDSsharp + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file