Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 9 additions & 53 deletions Mediaburst.Text.csproj
Original file line number Diff line number Diff line change
@@ -1,68 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{695DABE3-1699-452B-A633-9649E1CADE4B}</ProjectGuid>
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Mediaburst.Text</RootNamespace>
<AssemblyName>Mediaburst.Text</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Description>Text encoding for the GSM Character set</Description>
<Company>Mediaburst Ltd</Company>
<Product>Mediaburst Text Encoding for GSM 03.38</Product>
<Copyright>Copyright © Mediaburst Ltd 2010</Copyright>
<Version>1.0.0.0</Version>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GSMEncoding.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Mediaburst.Text.nuspec" />
<Compile Remove="Tests\**" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 0 additions & 36 deletions Properties/AssemblyInfo.cs

This file was deleted.

46 changes: 23 additions & 23 deletions Tests/GsmEncodingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,79 +40,79 @@ public void GetBytes_NormalString_Success()

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

#region NULL tests

/// <summary>
/// NULL character in the middle of string should be replaced with space (0x20)
/// </summary>
[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";
var expectedResult = new byte[] { 97, 32, 98 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// NULL character in the middle of string should not be replaced with space (32) if followed by FORM FEED
/// </summary>
[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";
var expectedResult = new byte[] { 97, 0, 27, 10, 98 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// Sequence of NULL characters in the middle of string should be replaced with spaces (32)
/// </summary>
[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";
var expectedResult = new byte[] { 97, 32, 32, 32, 98 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// Sequence of NULL characters followed by form feed in the middle of string should not be replaced with spaces (32)
/// </summary>
[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";
var expectedResult = new byte[] { 97, 0, 0, 0, 27, 10, 98 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// NULL character in the end of string should be encoded as NULL
/// </summary>
[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";
var expectedResult = new byte[] { 97, 98, 0 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

#endregion NULL tests
Expand All @@ -130,58 +130,58 @@ public void GetBytes_AtInTheMiddleOfString_Success()

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// COMMERCIAL AT character in the end of string. Encoder should append CARRIAGE RETURN
/// </summary>
[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@";
var expectedResult = new byte[] { 97, 98, 0, 13 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// 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
/// </summary>
[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";
var expectedResult = new byte[] { 97, 0, 32, 98 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// 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
/// </summary>
[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";
var expectedResult = new byte[] { 97, 98, 0, 13, 0 };

var result = m_GsmEncoding.GetBytes(input);

Assert.AreEqual(expectedResult, result);
Assert.That(result, Is.EqualTo(expectedResult));
}

/// <summary>
/// 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
/// </summary>
[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";
Expand All @@ -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
Expand All @@ -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));
}

/// <summary>
Expand All @@ -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));
}

/// <summary>
Expand All @@ -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));
}


Expand Down
66 changes: 9 additions & 57 deletions Tests/Mediaburst.Text.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,68 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3427C04B-0634-45BD-B516-7DD7A8E645FB}</ProjectGuid>
<TargetFrameworks>net40;net48</TargetFrameworks>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Mediaburst.Text.Tests</RootNamespace>
<AssemblyName>Mediaburst.Text.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GsmEncodingTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mediaburst.Text.csproj">
<Project>{695DABE3-1699-452B-A633-9649E1CADE4B}</Project>
<Name>Mediaburst.Text</Name>
</ProjectReference>
<ProjectReference Include="..\Mediaburst.Text.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="NUnit" Version="2.6.4" />
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading