public void SemanticVersionDTOFieldsTest() { SemanticVersionDTO dtoStart = Misc.CreateSemanticVersionDTO; Misc.Compare(dtoStart.PublicId, Misc.g1, Misc.g2, Misc.g3, Misc.g4); Assert.True(dtoStart.StampDTO.CompareTo(Misc.CreateStampDTO) == 0); FieldCompare.Same(dtoStart.Fields, new Object[] { 1, "abcdef", 0.3F }); }
public void FieldCompareTest() { { Assert.True(FieldCompare.Same("abc", "abc")); Assert.False(FieldCompare.Same("abc", "abcd")); } { Assert.True(FieldCompare.Same(0, 0)); Assert.False(FieldCompare.Same(0, 1)); } { Assert.True(FieldCompare.Same(0.1F, 0.1F)); Assert.False(FieldCompare.Same(0.0F, 1.0F)); } { Assert.True(FieldCompare.Same(true, true)); Assert.False(FieldCompare.Same(true, false)); } { Assert.True(FieldCompare.Same(new DateTime(2020, 1, 1), new DateTime(2020, 1, 1))); Assert.False(FieldCompare.Same(new DateTime(2020, 1, 1), new DateTime(2020, 2, 1))); } { Assert.True(FieldCompare.Same(new byte[] { 1, 2, 3 }, new byte[] { 1, 2, 3 })); Assert.False(FieldCompare.Same(new byte[] { 1, 2, 3 }, new byte[] { 1, 3, 2 })); } { Assert.True(FieldCompare.Same(Misc.CreateConceptChronologyDTO, Misc.CreateConceptChronologyDTO)); Assert.False(FieldCompare.Same( Misc.CreateConceptChronologyDTO, Misc.CreateConceptChronologyDTO with { PublicId = new PublicId(Misc.g2, Misc.g2, Misc.g3, Misc.g4) }));