Normalize cr/lf/tab

This commit is contained in:
Stephan
2017-07-20 11:21:28 +02:00
parent fa6c147a65
commit c76403077f
2466 changed files with 26012 additions and 26010 deletions

View File

@@ -13,13 +13,13 @@ namespace Umbraco.Tests.Strings
[TestFixture]
public class StringExtensionsTests : UmbracoTestBase
{
public override void SetUp()
{
public override void SetUp()
{
base.SetUp();
// fixme - in "compose"?
Container.RegisterSingleton<IShortStringHelper>(_ => new MockShortStringHelper());
}
}
[Test]
public void CurrentHelper()
@@ -63,36 +63,36 @@ namespace Umbraco.Tests.Strings
Assert.AreEqual(stripped, result);
}
[TestCase("This is a string to encrypt")]
[TestCase("This is a string to encrypt\nThis is a second line")]
[TestCase(" White space is preserved ")]
[TestCase("\nWhite space is preserved\n")]
public void Encrypt_And_Decrypt(string input)
{
var encrypted = input.EncryptWithMachineKey();
var decrypted = encrypted.DecryptWithMachineKey();
Assert.AreNotEqual(input, encrypted);
Assert.AreEqual(input, decrypted);
}
[TestCase("This is a string to encrypt")]
[TestCase("This is a string to encrypt\nThis is a second line")]
[TestCase(" White space is preserved ")]
[TestCase("\nWhite space is preserved\n")]
public void Encrypt_And_Decrypt(string input)
{
var encrypted = input.EncryptWithMachineKey();
var decrypted = encrypted.DecryptWithMachineKey();
Assert.AreNotEqual(input, encrypted);
Assert.AreEqual(input, decrypted);
}
[Test()]
public void Encrypt_And_Decrypt_Long_Value()
{
// Generate a really long string
char[] chars = { 'a', 'b', 'c', '1', '2', '3', '\n' };
[Test()]
public void Encrypt_And_Decrypt_Long_Value()
{
// Generate a really long string
char[] chars = { 'a', 'b', 'c', '1', '2', '3', '\n' };
string valueToTest = string.Empty;
string valueToTest = string.Empty;
// Create a string 7035 chars long
for (int i = 0; i < 1005; i++)
for (int j = 0; j < chars.Length; j++)
valueToTest += chars[j].ToString();
// Create a string 7035 chars long
for (int i = 0; i < 1005; i++)
for (int j = 0; j < chars.Length; j++)
valueToTest += chars[j].ToString();
var encrypted = valueToTest.EncryptWithMachineKey();
var decrypted = encrypted.DecryptWithMachineKey();
Assert.AreNotEqual(valueToTest, encrypted);
Assert.AreEqual(valueToTest, decrypted);
}
var encrypted = valueToTest.EncryptWithMachineKey();
var decrypted = encrypted.DecryptWithMachineKey();
Assert.AreNotEqual(valueToTest, encrypted);
Assert.AreEqual(valueToTest, decrypted);
}
[TestCase("Hello this is my string", " string", "Hello this is my")]
[TestCase("Hello this is my string strung", " string", "Hello this is my string strung")]

View File

@@ -1,4 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using NUnit.Framework;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
@@ -27,4 +27,4 @@ namespace Umbraco.Tests.Strings
}
}
}
}

View File

@@ -67,18 +67,18 @@ p {
[TestCase("Test", "p", @"font-size: 1em;
color:red; font-weight:bold;
text-align:left;", @"/** umb_name: Test */ p { font-size: 1em;
text-align:left;", @"/** umb_name: Test */ p { font-size: 1em;
color:red; font-weight:bold;
text-align:left;
text-align:left;
}")]
// All on one line with no spaces
[TestCase("Test", "p", "font-size: 1em;", @"/**UMB_NAME:Test*/p{font-size: 1em;}")]
// Has a name with spaces
[TestCase("Hello world", "p", "font-size: 1em;", @"/**UMB_NAME:Hello world */p{font-size: 1em;}")]
[TestCase("Hello world", "p", "font-size: 1em;", @"/**UMB_NAME:Hello world */p{font-size: 1em;}")]
// Every part on a new line
[TestCase("Test", "p", "font-size: 1em;", @"/**
[TestCase("Test", "p", "font-size: 1em;", @"/**
umb_name:
Test
*/
@@ -88,7 +88,7 @@ font-size: 1em;
}")]
public void ParseRules_Parses(string name, string selector, string styles, string css)
{
// Act
var results = StylesheetHelper.ParseRules(css);
@@ -119,12 +119,12 @@ p, h2
//Only a single asterisk
[TestCase("/* umb_name: Test */ p { font-size: 1em; }")]
// Has a name with spaces over multiple lines
[TestCase(@"/**UMB_NAME:Hello
[TestCase(@"/**UMB_NAME:Hello
world */p{font-size: 1em;}")]
public void ParseRules_DoesntParse(string css)
{
// Act
var results = StylesheetHelper.ParseRules(css);