mirror of
https://github.com/claunia/plist-cil.git
synced 2025-12-16 19:14:26 +00:00
General refactor and clean-up.
This commit is contained in:
@@ -1,29 +1,28 @@
|
||||
using Claunia.PropertyList;
|
||||
using Xunit;
|
||||
|
||||
namespace plistcil.test
|
||||
namespace plistcil.test;
|
||||
|
||||
public class NSStringTests
|
||||
{
|
||||
public class NSStringTests
|
||||
const string START_TOKEN = "<string>";
|
||||
const string END_TOKEN = "</string>";
|
||||
|
||||
[InlineData("abc", "abc")]
|
||||
[InlineData("a>b", "a>b")]
|
||||
[InlineData("a<b", "a<b")]
|
||||
[InlineData("a&b", "a&b")]
|
||||
[Theory]
|
||||
public void Content_IsEscaped(string value, string content)
|
||||
{
|
||||
const string START_TOKEN = "<string>";
|
||||
const string END_TOKEN = "</string>";
|
||||
var element = new NSString(value);
|
||||
string xml = element.ToXmlPropertyList();
|
||||
|
||||
[InlineData("abc", "abc")]
|
||||
[InlineData("a>b", "a>b")]
|
||||
[InlineData("a<b", "a<b")]
|
||||
[InlineData("a&b", "a&b")]
|
||||
[Theory]
|
||||
public void Content_IsEscaped(string value, string content)
|
||||
{
|
||||
var element = new NSString(value);
|
||||
string xml = element.ToXmlPropertyList();
|
||||
// Strip the leading and trailing data, so we just get the string element itself
|
||||
int start = xml.IndexOf(START_TOKEN) + START_TOKEN.Length;
|
||||
int end = xml.IndexOf(END_TOKEN);
|
||||
string actualContent = xml.Substring(start, end - start);
|
||||
|
||||
// Strip the leading and trailing data, so we just get the string element itself
|
||||
int start = xml.IndexOf(START_TOKEN) + START_TOKEN.Length;
|
||||
int end = xml.IndexOf(END_TOKEN);
|
||||
string actualContent = xml.Substring(start, end - start);
|
||||
|
||||
Assert.Equal(content, actualContent);
|
||||
}
|
||||
Assert.Equal(content, actualContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user