From 05146827eb9aacff31ee5dc2d2ae03d68f12ef59 Mon Sep 17 00:00:00 2001 From: "Christian I. Nilsson" Date: Mon, 3 Mar 2025 13:06:56 +0100 Subject: [PATCH 1/4] Convert to SDK style projects --- Mediaburst.Text.csproj | 62 +++++------------------------- Properties/AssemblyInfo.cs | 36 ----------------- Tests/Mediaburst.Text.Tests.csproj | 61 ++--------------------------- Tests/Properties/AssemblyInfo.cs | 36 ----------------- Tests/packages.config | 4 -- 5 files changed, 13 insertions(+), 186 deletions(-) delete mode 100644 Properties/AssemblyInfo.cs delete mode 100644 Tests/Properties/AssemblyInfo.cs delete mode 100644 Tests/packages.config diff --git a/Mediaburst.Text.csproj b/Mediaburst.Text.csproj index 0daaa55..402e81d 100644 --- a/Mediaburst.Text.csproj +++ b/Mediaburst.Text.csproj @@ -1,68 +1,24 @@ - - + - Debug - AnyCPU - 8.0.30703 - 2.0 - {695DABE3-1699-452B-A633-9649E1CADE4B} + net40 Library - Properties - Mediaburst.Text - Mediaburst.Text - v4.0 - 512 + Text encoding for the GSM Character set + Mediaburst Ltd + Mediaburst Text Encoding for GSM 03.38 + Copyright © Mediaburst Ltd 2010 + 1.0.0.0 SAK SAK SAK SAK - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - + - - - - - - - - - - - - - - + - - \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs deleted file mode 100644 index d4fe8b6..0000000 --- a/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -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("Mediaburst.Text")] -[assembly: AssemblyDescription("Text encoding for the GSM Character set")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Mediaburst Ltd")] -[assembly: AssemblyProduct("Mediaburst Text Encoding for GSM 03.38")] -[assembly: AssemblyCopyright("Copyright © Mediaburst Ltd 2010")] -[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("090ec8b1-ec55-402c-92b7-f3bf71620179")] - -// 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/Mediaburst.Text.Tests.csproj b/Tests/Mediaburst.Text.Tests.csproj index b19f04c..2fef85e 100644 --- a/Tests/Mediaburst.Text.Tests.csproj +++ b/Tests/Mediaburst.Text.Tests.csproj @@ -1,68 +1,15 @@ - - + - Debug - AnyCPU - 8.0.30703 - 2.0 - {3427C04B-0634-45BD-B516-7DD7A8E645FB} + net40 Library - Properties - Mediaburst.Text.Tests - Mediaburst.Text.Tests - v4.0 - 512 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 true - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - - - - - - - - - - {695DABE3-1699-452B-A633-9649E1CADE4B} - Mediaburst.Text - + - + - - \ No newline at end of file diff --git a/Tests/Properties/AssemblyInfo.cs b/Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 4747fae..0000000 --- a/Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -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 © 2012")] -[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("e328ad74-b600-4ba1-b839-f88cdec3230a")] - -// 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/packages.config b/Tests/packages.config deleted file mode 100644 index 904dc42..0000000 --- a/Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From 97e51d7a674fd7157333f09458c6d098a631c211 Mon Sep 17 00:00:00 2001 From: "Christian I. Nilsson" Date: Mon, 3 Mar 2025 13:17:57 +0100 Subject: [PATCH 2/4] Add netstandard 2.0 target to library --- Mediaburst.Text.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mediaburst.Text.csproj b/Mediaburst.Text.csproj index 402e81d..095620a 100644 --- a/Mediaburst.Text.csproj +++ b/Mediaburst.Text.csproj @@ -1,6 +1,6 @@  - net40 + net40;netstandard2.0 Library Text encoding for the GSM Character set Mediaburst Ltd From 34b3ff587d146512201e0e335af1814e7f6076b3 Mon Sep 17 00:00:00 2001 From: "Christian I. Nilsson" Date: Mon, 3 Mar 2025 13:19:05 +0100 Subject: [PATCH 3/4] Add NET4.8 target to test project along with analyzer and testadapter --- Tests/Mediaburst.Text.Tests.csproj | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tests/Mediaburst.Text.Tests.csproj b/Tests/Mediaburst.Text.Tests.csproj index 2fef85e..72db635 100644 --- a/Tests/Mediaburst.Text.Tests.csproj +++ b/Tests/Mediaburst.Text.Tests.csproj @@ -1,6 +1,6 @@  - net40 + net40;net48 Library @@ -11,5 +11,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + \ No newline at end of file From 94f40d5c776ded3f993b2822b80cebb980d57bf1 Mon Sep 17 00:00:00 2001 From: "Christian I. Nilsson" Date: Mon, 3 Mar 2025 13:19:19 +0100 Subject: [PATCH 4/4] Tests refactor to use Assert.That --- Tests/GsmEncodingTests.cs | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Tests/GsmEncodingTests.cs b/Tests/GsmEncodingTests.cs index a40e9e7..73bfd0b 100644 --- a/Tests/GsmEncodingTests.cs +++ b/Tests/GsmEncodingTests.cs @@ -40,7 +40,7 @@ public void GetBytes_NormalString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } #region NULL tests @@ -48,7 +48,7 @@ public void GetBytes_NormalString_Success() /// /// NULL character in the middle of string should be replaced with space (0x20) /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_NullInsideString_Success() { const string input = "a\0b"; @@ -56,13 +56,13 @@ public void GetBytes_NullInsideString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// NULL character in the middle of string should not be replaced with space (32) if followed by FORM FEED /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_NullFollowedByFormFeedInsideString_Success() { string input = "a\0" + _FF + "b"; @@ -70,13 +70,13 @@ public void GetBytes_NullFollowedByFormFeedInsideString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// Sequence of NULL characters in the middle of string should be replaced with spaces (32) /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_SequenceOfNullsInsideString_Success() { const string input = "a\0\0\0b"; @@ -84,13 +84,13 @@ public void GetBytes_SequenceOfNullsInsideString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// Sequence of NULL characters followed by form feed in the middle of string should not be replaced with spaces (32) /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_SequenceOfNullsFollowedByFormFeedInsideString_Success() { var input = "a\0\0\0" + _FF + "b"; @@ -98,13 +98,13 @@ public void GetBytes_SequenceOfNullsFollowedByFormFeedInsideString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// NULL character in the end of string should be encoded as NULL /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_NullInTheEndOfString_Success() { const string input = "ab\0"; @@ -112,7 +112,7 @@ public void GetBytes_NullInTheEndOfString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } #endregion NULL tests @@ -130,13 +130,13 @@ public void GetBytes_AtInTheMiddleOfString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// COMMERCIAL AT character in the end of string. Encoder should append CARRIAGE RETURN /// - [Test, Ignore] // Think the behaviour is wrong here + [Test, Ignore("Think the behaviour is wrong here")] public void GetBytes_AtInTheEndOfString_Success() { const string input = "ab@"; @@ -144,14 +144,14 @@ public void GetBytes_AtInTheEndOfString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// COMMERCIAL AT character in the middle of string followed by NULL. /// Encoder should not append CARRIAGE RETURN because this NULL will be converted to space /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_AtFollowedByNullInTheMiddleOfString_Success() { const string input = "a@\0b"; @@ -159,14 +159,14 @@ public void GetBytes_AtFollowedByNullInTheMiddleOfString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// COMMERCIAL AT character in the end of string followed by NULL. /// Encoder should append CARRIAGE RETURN because this NULL will not be converted to space /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_AtFollowedByNullInTheEndOfString_Success() { const string input = "ab@\0"; @@ -174,14 +174,14 @@ public void GetBytes_AtFollowedByNullInTheEndOfString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } /// /// COMMERCIAL AT character in the middle of string followed by NULL and FORM FEED. /// Encoder should append CARRIAGE RETURN and not replace NULL with space /// - [Test, Ignore] // Need to check expected behaviour on this + [Test, Ignore("Need to check expected behaviour on this")] public void GetBytes_AtFollowedByNullAndFormFeedInTheMiddleOfString_Success() { var input = "a@\0" + _FF + "b"; @@ -195,7 +195,7 @@ public void GetBytes_AtFollowedByNullAndFormFeedInTheMiddleOfString_Success() var result = m_GsmEncoding.GetBytes(input); - Assert.AreEqual(expectedResult, result); + Assert.That(result, Is.EqualTo(expectedResult)); } #endregion COMMERCIAL AT tests @@ -213,7 +213,7 @@ public void GetBytesGetString_ExtendedTableChars_Success() var encoded = m_GsmEncoding.GetBytes(_AllExtTableChars); var decoded = m_GsmEncoding.GetString(encoded); - Assert.AreEqual(_AllExtTableChars, decoded); + Assert.That(decoded, Is.EqualTo(_AllExtTableChars)); } /// @@ -225,7 +225,7 @@ public void GetBytesGetString_MainTableChars_Success() var encoded = m_GsmEncoding.GetBytes(_AllMainTableChars); var decoded = m_GsmEncoding.GetString(encoded); - Assert.AreEqual(_AllMainTableChars, decoded); + Assert.That(decoded, Is.EqualTo(_AllMainTableChars)); } /// @@ -239,7 +239,7 @@ public void GetBytesGetString_CurrencySymbols_Success() var encoded = m_GsmEncoding.GetBytes(input); var decoded = m_GsmEncoding.GetString(encoded); - Assert.AreEqual(input, decoded); + Assert.That(decoded, Is.EqualTo(input)); }