Split normal tests from game api tests

This commit is contained in:
jvyden 2021-12-22 22:33:50 -05:00
parent 68eb6aeb3e
commit 1fbabe0000
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
11 changed files with 74 additions and 14 deletions

View file

@ -0,0 +1,43 @@
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"))
);
}
}
}