mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-09 03:52:26 +00:00
42 lines
No EOL
1.2 KiB
C#
42 lines
No EOL
1.2 KiB
C#
using System.Collections.Generic;
|
|
using LBPUnion.ProjectLighthouse.Serialization;
|
|
using Xunit;
|
|
|
|
namespace LBPUnion.ProjectLighthouse.Tests;
|
|
|
|
public class SerializerTests
|
|
{
|
|
[Fact]
|
|
public void BlankElementWorks()
|
|
{
|
|
Assert.Equal("<test></test>", LbpSerializer.BlankElement("test"));
|
|
}
|
|
|
|
[Fact]
|
|
public void StringElementWorks()
|
|
{
|
|
Assert.Equal("<test>asd</test>", LbpSerializer.StringElement("test", "asd"));
|
|
Assert.Equal("<test>asd</test>", LbpSerializer.StringElement(new KeyValuePair<string, object>("test", "asd")));
|
|
}
|
|
|
|
[Fact]
|
|
public void TaggedStringElementWorks()
|
|
{
|
|
Assert.Equal("<test foo=\"bar\">asd</test>", LbpSerializer.TaggedStringElement("test", "asd", "foo", "bar"));
|
|
Assert.Equal
|
|
(
|
|
"<test foo=\"bar\">asd</test>",
|
|
LbpSerializer.TaggedStringElement(new KeyValuePair<string, object>("test", "asd"), new KeyValuePair<string, object>("foo", "bar"))
|
|
);
|
|
}
|
|
|
|
[Fact]
|
|
public void ElementsWorks()
|
|
{
|
|
Assert.Equal
|
|
(
|
|
"<test>asd</test><foo>bar</foo>",
|
|
LbpSerializer.Elements(new KeyValuePair<string, object>("test", "asd"), new KeyValuePair<string, object>("foo", "bar"))
|
|
);
|
|
}
|
|
} |