Fixes unit tests
This commit is contained in:
@@ -41,6 +41,16 @@ namespace Umbraco.Core
|
||||
ToCSharpEscapeChars[escape[0]] = escape[1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes new lines and tabs
|
||||
/// </summary>
|
||||
/// <param name="txt"></param>
|
||||
/// <returns></returns>
|
||||
internal static string StripWhitespace(this string txt)
|
||||
{
|
||||
return Regex.Replace(txt, @"\s", string.Empty);
|
||||
}
|
||||
|
||||
internal static string StripFileExtension(this string fileName)
|
||||
{
|
||||
//filenames cannot contain line breaks
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web.UI.JavaScript;
|
||||
|
||||
namespace Umbraco.Tests.Web.AngularIntegration
|
||||
@@ -29,7 +30,7 @@ namespace Umbraco.Tests.Web.AngularIntegration
|
||||
angular.bootstrap(document, ['umbraco']);
|
||||
|
||||
});
|
||||
});", result);
|
||||
});".StripWhitespace(), result.StripWhitespace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Web.UI.JavaScript;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Tests.Web.AngularIntegration
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Umbraco.Tests.Web.AngularIntegration
|
||||
d.Add("test4", "Test 4");
|
||||
d.Add("test5", "Test 5");
|
||||
|
||||
var output = ServerVariablesParser.Parse(d);
|
||||
var output = ServerVariablesParser.Parse(d).StripWhitespace();
|
||||
|
||||
Assert.IsTrue(output.Contains(@"Umbraco.Sys.ServerVariables = {
|
||||
""test1"": ""Test 1"",
|
||||
@@ -27,7 +28,7 @@ namespace Umbraco.Tests.Web.AngularIntegration
|
||||
""test3"": ""Test 3"",
|
||||
""test4"": ""Test 4"",
|
||||
""test5"": ""Test 5""
|
||||
} ;"));
|
||||
} ;".StripWhitespace()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user