Added unit test to verify line endings
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
<Compile Include="ResourceParserErrorHandlingTests.cs" />
|
||||
<Compile Include="ResourceParserTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="StringExtensionTests.cs" />
|
||||
<Compile Include="VisualBasicCodeGeneratorTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using ChristianHelle.DeveloperTools.CodeGenerators.Resw.VSPackage.CustomTool;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace ChristianHelle.DeveloperTools.CodeGenerators.Resw.CustomTool.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class StringExtensionTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void LineEndingsAreSame()
|
||||
{
|
||||
uint length;
|
||||
var target = string.Format("First line{0}Second line{0}", Environment.NewLine);
|
||||
var ptr = target.ConvertToIntPtr(out length);
|
||||
var actual = Marshal.PtrToStringAuto(ptr);
|
||||
Assert.AreEqual(target, actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user