2016-02-17 10:59:48 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using NUnit.Framework;
|
2016-02-17 13:28:11 +01:00
|
|
|
|
using Umbraco.Core;
|
2019-01-29 23:05:59 +11:00
|
|
|
|
using Umbraco.Web.JavaScript;
|
2016-02-17 10:59:48 +01:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Tests.Web.AngularIntegration
|
|
|
|
|
|
{
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
|
public class ServerVariablesParserTests
|
|
|
|
|
|
{
|
2017-07-20 11:21:28 +02:00
|
|
|
|
|
2016-02-17 10:59:48 +01:00
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
public void Parse()
|
|
|
|
|
|
{
|
|
|
|
|
|
var d = new Dictionary<string, object>();
|
|
|
|
|
|
d.Add("test1", "Test 1");
|
|
|
|
|
|
d.Add("test2", "Test 2");
|
|
|
|
|
|
d.Add("test3", "Test 3");
|
|
|
|
|
|
d.Add("test4", "Test 4");
|
|
|
|
|
|
d.Add("test5", "Test 5");
|
|
|
|
|
|
|
2016-02-17 13:28:11 +01:00
|
|
|
|
var output = ServerVariablesParser.Parse(d).StripWhitespace();
|
2016-02-17 10:59:48 +01:00
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(output.Contains(@"Umbraco.Sys.ServerVariables = {
|
|
|
|
|
|
""test1"": ""Test 1"",
|
|
|
|
|
|
""test2"": ""Test 2"",
|
|
|
|
|
|
""test3"": ""Test 3"",
|
|
|
|
|
|
""test4"": ""Test 4"",
|
|
|
|
|
|
""test5"": ""Test 5""
|
2016-02-17 13:28:11 +01:00
|
|
|
|
} ;".StripWhitespace()));
|
2016-02-17 10:59:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|