Add test for finding constructor
This commit is contained in:
Родитель
e1d07929b2
Коммит
2909b5d5f9
|
@ -518,6 +518,24 @@ namespace SharedData
|
|||
}
|
||||
}
|
||||
|
||||
public class FindingConstructorCheck
|
||||
{
|
||||
public int MyProperty1 { get; set; }
|
||||
public string MyProperty2 { get; set; }
|
||||
|
||||
|
||||
public FindingConstructorCheck(KeyValuePair<int, string> ok)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public FindingConstructorCheck(int myProperty1, string myProperty2)
|
||||
{
|
||||
this.MyProperty1 = myProperty1;
|
||||
this.MyProperty2 = myProperty2;
|
||||
}
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class ArrayOptimizeClass
|
||||
{
|
||||
|
|
|
@ -302,6 +302,17 @@ namespace MessagePack.Tests
|
|||
re.MyProperty2.Is("hogehoge");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FindingConstructor()
|
||||
{
|
||||
var data = new FindingConstructorCheck(10, "hogehoge");
|
||||
var bin = MessagePackSerializer.Serialize(data, DynamicContractlessObjectResolver.Instance);
|
||||
var re = MessagePackSerializer.Deserialize<FindingConstructorCheck>(bin, MessagePack.Resolvers.DynamicContractlessObjectResolver.Instance);
|
||||
|
||||
re.MyProperty1.Is(10);
|
||||
re.MyProperty2.Is("hogehoge");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NestedClass()
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче