mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-09 14:34:05 +02:00
Add an enum test to FileSerializer unit test
This commit is contained in:
parent
796fb348a3
commit
38c2781cd3
@ -6,11 +6,16 @@
|
||||
namespace UnitTests.Data{
|
||||
[TestClass]
|
||||
public class TestFileSerializer{
|
||||
private enum TestEnum{
|
||||
A, B, C, D, E
|
||||
}
|
||||
|
||||
private class SerializationTestBasic : ISerializedObject{
|
||||
public bool TestBool { get; set; }
|
||||
public int TestInt { get; set; }
|
||||
public string TestString { get; set; }
|
||||
public string TestStringNull { get; set; }
|
||||
public TestEnum TestEnum { get; set; }
|
||||
|
||||
bool ISerializedObject.OnReadUnknownProperty(string property, string value){
|
||||
return false;
|
||||
@ -25,7 +30,8 @@ public void TestBasicWriteRead(){
|
||||
TestBool = true,
|
||||
TestInt = -100,
|
||||
TestString = "abc"+Environment.NewLine+"def",
|
||||
TestStringNull = null
|
||||
TestStringNull = null,
|
||||
TestEnum = TestEnum.D
|
||||
};
|
||||
|
||||
serializer.Write("serialized_basic", write);
|
||||
@ -40,6 +46,9 @@ public void TestBasicWriteRead(){
|
||||
Assert.AreEqual(-100, read.TestInt);
|
||||
Assert.AreEqual("abc"+Environment.NewLine+"def", read.TestString);
|
||||
Assert.IsNull(read.TestStringNull);
|
||||
Assert.AreEqual(TestEnum.D, read.TestEnum);
|
||||
}
|
||||
|
||||
// TODO more complex tests
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user