public void FieldDefinitionDTOJsonMarshal() { FieldDefinitionDTO dtoStart = Misc.CreateFieldDefinitionDTO; MemoryStream ms = new MemoryStream(); using (TinkarJsonOutput output = new TinkarJsonOutput(ms, true)) { dtoStart.Marshal(output); } ms.Dump(); ms.Position = 0; using (TinkarJsonInput input = new TinkarJsonInput(ms)) { FieldDefinitionDTO dtoEnd = FieldDefinitionDTO.Make(input.ReadJsonObject()); Assert.True(dtoStart.CompareTo(dtoEnd) == 0); } }
public void FieldDefinitionDTOMarshalTest() { FieldDefinitionDTO dtoStart = new FieldDefinitionDTO( Misc.PublicIdG, Misc.PublicIdH, Misc.PublicIdI ); MemoryStream ms = new MemoryStream(); using (TinkarOutput output = new TinkarOutput(ms)) { dtoStart.Marshal(output); } ms.Position = 0; using (TinkarInput input = new TinkarInput(ms)) { FieldDefinitionDTO dtoRead = FieldDefinitionDTO.Make(input); Assert.True(dtoStart.CompareTo(dtoRead) == 0); } }
public void FieldDefinitionDTOCompareToTest() { { FieldDefinitionDTO a = Misc.CreateFieldDefinition; FieldDefinitionDTO b = Misc.CreateFieldDefinition; Assert.True(a.CompareTo(b) == 0); } { FieldDefinitionDTO a = Misc.CreateFieldDefinition; FieldDefinitionDTO b = Misc.CreateFieldDefinition with { DataTypePublicId = new PublicId(Misc.g2, Misc.g2, Misc.g3, Misc.g4) } ; Assert.False(a.CompareTo(b) == 0); } { FieldDefinitionDTO a = Misc.CreateFieldDefinition; FieldDefinitionDTO b = Misc.CreateFieldDefinition with { PurposePublicId = new PublicId(Misc.h1) }; Assert.False(a.CompareTo(b) == 0); } { FieldDefinitionDTO a = Misc.CreateFieldDefinition; FieldDefinitionDTO b = Misc.CreateFieldDefinition with { MeaningPublicId = new PublicId(Misc.i1, Misc.i2, Misc.i3, Misc.i3) }; Assert.False(a.CompareTo(b) == 0); } }