mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-11 22:38:39 +00:00
Add SerializerTests
This commit is contained in:
parent
0df715045d
commit
5e31bb8c31
2 changed files with 32 additions and 1 deletions
|
@ -5,7 +5,7 @@ using ProjectLighthouse.Types;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests {
|
namespace ProjectLighthouse.Tests {
|
||||||
public class AuthenticationTest : LighthouseTest {
|
public class AuthenticationTests : LighthouseTest {
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task ShouldReturnErrorOnNoPostData() {
|
public async Task ShouldReturnErrorOnNoPostData() {
|
||||||
HttpResponseMessage response = await this.Client.PostAsync("/LITTLEBIGPLANETPS3_XML/login", null!);
|
HttpResponseMessage response = await this.Client.PostAsync("/LITTLEBIGPLANETPS3_XML/login", null!);
|
31
ProjectLighthouse.Tests/Tests/SerializerTests.cs
Normal file
31
ProjectLighthouse.Tests/Tests/SerializerTests.cs
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using ProjectLighthouse.Serialization;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace ProjectLighthouse.Tests {
|
||||||
|
public class SerializerTests : LighthouseTest {
|
||||||
|
[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")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue