public ContractEventModel(ContractEventDescriptor e) { if (e != null) { Name = e.Name; Parameters = e.Parameters.Select(p => new ContractParameterModel(p)).ToArray(); } }
public void TestFromJson() { ContractEventDescriptor expected = new ContractEventDescriptor { Name = "AAA", Parameters = new ContractParameterDefinition[0] }; ContractEventDescriptor actual = ContractEventDescriptor.FromJson(expected.ToJson()); Assert.AreEqual(expected.Name, actual.Name); Assert.AreEqual(0, actual.Parameters.Length); }