// ReSharper disable InconsistentNaming - Unit Test
public void DebugIem_SaveFile_WithContentsNewLineChars_ExpectedSavesFileToDiskWithCorrectChars()
// ReSharper restore InconsistentNaming
{
var debugState = new DebugItem();
debugState.ClearFile("TestFile.txt");
EnvironmentVariables.WebServerUri = "http://localhost:3142";
string expeced = "\r\nThis is\r\n the text\\n that we are writing";
string textToWrite = "\nThis is\r\n the text\\n that we are writing";
var uri = debugState.SaveFile(textToWrite, "TestFile.txt");
var path = new Uri(uri).OriginalString.Replace("?DebugItemFilePath=", "").Replace(EnvironmentVariables.WebServerUri + "/Services/FetchDebugItemFileService", "");
var exists = File.Exists(path);
Assert.IsTrue(exists);
var contents = File.ReadAllText(path);
Assert.AreEqual(expeced, contents);
}