Files
reswcodegen/RESW File Code Generator/ReswCodeGen.Tests/StringExtensionTests.cs
T

29 lines
1002 B
C#
Raw Normal View History

2013-05-28 00:12:28 +02:00
using System;
2013-05-28 00:23:18 +02:00
using System.IO;
2013-05-28 00:12:28 +02:00
using System.Runtime.InteropServices;
using ChristianHelle.DeveloperTools.CodeGenerators.Resw.VSPackage.CustomTool;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ChristianHelle.DeveloperTools.CodeGenerators.Resw.CustomTool.Tests
{
[TestClass]
2013-05-28 00:23:18 +02:00
[DeploymentItem("Resources/Resources.resw")]
2013-05-28 00:12:28 +02:00
public class StringExtensionTests
{
2013-05-28 00:23:18 +02:00
private const string FILE_PATH = "Resources.resw";
2013-05-28 00:12:28 +02:00
[TestMethod]
public void LineEndingsAreSame()
{
2013-05-28 00:23:18 +02:00
var reswFileContents = File.ReadAllText(FILE_PATH);
var target = new CodeGeneratorFactory().Create(FILE_PATH.Replace(".resw", string.Empty), "TestApp", reswFileContents);
var expected = target.GenerateCode();
2013-05-28 00:12:28 +02:00
uint length;
2013-05-28 00:23:18 +02:00
var ptr = expected.ConvertToIntPtr(out length);
var actual = Marshal.PtrToStringAnsi(ptr);
Assert.AreEqual(expected, actual);
2013-05-28 00:12:28 +02:00
}
}
}