From b04b45fef94056acc607e5a93bff7f23f8237f68 Mon Sep 17 00:00:00 2001 From: Konstantin Gonsovsky Date: Mon, 3 Apr 2023 11:25:21 +0300 Subject: [PATCH] StronglyTypedId.Tennisi --- .../StronglyTypedIdImplementations.cs | 16 ++- src/StronglyTypedIds/EmbeddedSources.cs | 19 +++ src/StronglyTypedIds/ParentClass.cs | 4 +- .../SourceGenerationHelper.cs | 45 +++++- .../Templates/Guid/Guid_Base.cs | 1 - .../Templates/Guid/Guid_Convertible.cs | 89 ++++++++++++ .../Templates/Guid/Guid_StronglyTypedId.cs | 5 + .../Templates/Int/Int_Base.cs | 1 + .../Templates/Int/Int_Convertible.cs | 89 ++++++++++++ .../Templates/Int/Int_StronglyTypedId.cs | 5 + .../Templates/Long/Long_Base.cs | 1 + .../Templates/Long/Long_Convertible.cs | 89 ++++++++++++ .../Templates/Long/Long_StronglyTypedId.cs | 5 + .../Templates/NewId/NewId_Base.cs | 1 + .../Templates/NewId/NewId_Convertible.cs | 89 ++++++++++++ .../Templates/NewId/NewId_StronglyTypedId.cs | 5 + .../NullableString/NullableString_Base.cs | 1 + .../NullableString_Convertible.cs | 89 ++++++++++++ .../NullableString_StronglyTypedId.cs | 5 + .../Templates/String/String_Convertible.cs | 89 ++++++++++++ .../String/String_StronglyTypedId.cs | 5 + .../LongIdTests.cs | 2 +- .../StronglyTypedId.cs | 2 + .../Types/GuidId.cs | 2 +- .../Types/LongId.cs | 5 +- ...ypedIdImplementations.Core3_1.verified.txt | 16 ++- ...edIdImplementations.DotNet6_0.verified.txt | 16 ++- ...edIdImplementations.DotNet7_0.verified.txt | 16 ++- ...TypedIdImplementations.Net4_8.verified.txt | 16 ++- ...tronglyTypedIdImplementations.verified.txt | 16 ++- ...IdCorrectly_type=Guid.Core3_1.verified.txt | 99 ++++++++++++- ...Correctly_type=Guid.DotNet6_0.verified.txt | 99 ++++++++++++- ...Correctly_type=Guid.DotNet7_0.verified.txt | 99 ++++++++++++- ...lIdCorrectly_type=Guid.Net4_8.verified.txt | 99 ++++++++++++- ...atesFullIdCorrectly_type=Guid.verified.txt | 99 ++++++++++++- ...lIdCorrectly_type=Int.Core3_1.verified.txt | 99 ++++++++++++- ...dCorrectly_type=Int.DotNet6_0.verified.txt | 99 ++++++++++++- ...dCorrectly_type=Int.DotNet7_0.verified.txt | 99 ++++++++++++- ...llIdCorrectly_type=Int.Net4_8.verified.txt | 99 ++++++++++++- ...ratesFullIdCorrectly_type=Int.verified.txt | 99 ++++++++++++- ...IdCorrectly_type=Long.Core3_1.verified.txt | 99 ++++++++++++- ...Correctly_type=Long.DotNet6_0.verified.txt | 99 ++++++++++++- ...Correctly_type=Long.DotNet7_0.verified.txt | 99 ++++++++++++- ...lIdCorrectly_type=Long.Net4_8.verified.txt | 99 ++++++++++++- ...atesFullIdCorrectly_type=Long.verified.txt | 99 ++++++++++++- ...type=MassTransitNewId.Core3_1.verified.txt | 99 ++++++++++++- ...pe=MassTransitNewId.DotNet6_0.verified.txt | 99 ++++++++++++- ...pe=MassTransitNewId.DotNet7_0.verified.txt | 99 ++++++++++++- ..._type=MassTransitNewId.Net4_8.verified.txt | 99 ++++++++++++- ...rrectly_type=MassTransitNewId.verified.txt | 99 ++++++++++++- ...y_type=NullableString.Core3_1.verified.txt | 99 ++++++++++++- ...type=NullableString.DotNet6_0.verified.txt | 99 ++++++++++++- ...type=NullableString.DotNet7_0.verified.txt | 99 ++++++++++++- ...ly_type=NullableString.Net4_8.verified.txt | 99 ++++++++++++- ...Correctly_type=NullableString.verified.txt | 99 ++++++++++++- ...Correctly_type=String.Core3_1.verified.txt | 98 ++++++++++++- ...rrectly_type=String.DotNet6_0.verified.txt | 98 ++++++++++++- ...rrectly_type=String.DotNet7_0.verified.txt | 98 ++++++++++++- ...dCorrectly_type=String.Net4_8.verified.txt | 98 ++++++++++++- ...esFullIdCorrectly_type=String.verified.txt | 98 ++++++++++++- ...perTypeHandler_i=None.Core3_1.verified.txt | 1 - ...rTypeHandler_i=None.DotNet6_0.verified.txt | 1 - ...rTypeHandler_i=None.DotNet7_0.verified.txt | 1 - ...pperTypeHandler_i=None.Net4_8.verified.txt | 1 - ...id_c=DapperTypeHandler_i=None.verified.txt | 1 - ...ValueConverter_i=None.Core3_1.verified.txt | 1 - ...lueConverter_i=None.DotNet6_0.verified.txt | 1 - ...lueConverter_i=None.DotNet7_0.verified.txt | 1 - ...eValueConverter_i=None.Net4_8.verified.txt | 1 - ...c=EfCoreValueConverter_i=None.verified.txt | 1 - ...NewtonsoftJson_i=None.Core3_1.verified.txt | 1 - ...wtonsoftJson_i=None.DotNet6_0.verified.txt | 1 - ...wtonsoftJson_i=None.DotNet7_0.verified.txt | 1 - ...=NewtonsoftJson_i=None.Net4_8.verified.txt | 1 - ...=Guid_c=NewtonsoftJson_i=None.verified.txt | 1 - ..._c=None_i=IComparable.Core3_1.verified.txt | 1 - ...=None_i=IComparable.DotNet6_0.verified.txt | 1 - ...=None_i=IComparable.DotNet7_0.verified.txt | 1 - ...d_c=None_i=IComparable.Net4_8.verified.txt | 1 - ...ype=Guid_c=None_i=IComparable.verified.txt | 1 - ...c=None_i=IConvertible.Core3_1.verified.txt | 125 ++++++++++++++++ ...None_i=IConvertible.DotNet6_0.verified.txt | 125 ++++++++++++++++ ...None_i=IConvertible.DotNet7_0.verified.txt | 125 ++++++++++++++++ ..._c=None_i=IConvertible.Net4_8.verified.txt | 125 ++++++++++++++++ ...pe=Guid_c=None_i=IConvertible.verified.txt | 125 ++++++++++++++++ ...d_c=None_i=IEquatable.Core3_1.verified.txt | 1 - ...c=None_i=IEquatable.DotNet6_0.verified.txt | 1 - ...c=None_i=IEquatable.DotNet7_0.verified.txt | 1 - ...id_c=None_i=IEquatable.Net4_8.verified.txt | 1 - ...type=Guid_c=None_i=IEquatable.verified.txt | 1 - ...id_c=None_i=IParsable.Core3_1.verified.txt | 1 - ..._c=None_i=IParsable.DotNet6_0.verified.txt | 1 - ..._c=None_i=IParsable.DotNet7_0.verified.txt | 1 - ...uid_c=None_i=IParsable.Net4_8.verified.txt | 1 - ..._type=Guid_c=None_i=IParsable.verified.txt | 1 - ...ne_i=IStronglyTypedId.Core3_1.verified.txt | 41 ++++++ ..._i=IStronglyTypedId.DotNet6_0.verified.txt | 41 ++++++ ..._i=IStronglyTypedId.DotNet7_0.verified.txt | 41 ++++++ ...one_i=IStronglyTypedId.Net4_8.verified.txt | 41 ++++++ ...uid_c=None_i=IStronglyTypedId.verified.txt | 41 ++++++ ...pe=Guid_c=None_i=None.Core3_1.verified.txt | 1 - ...=Guid_c=None_i=None.DotNet6_0.verified.txt | 1 - ...=Guid_c=None_i=None.DotNet7_0.verified.txt | 1 - ...ype=Guid_c=None_i=None.Net4_8.verified.txt | 1 - ...ectly_type=Guid_c=None_i=None.verified.txt | 1 - ...erSchemaFilter_i=None.Core3_1.verified.txt | 1 - ...SchemaFilter_i=None.DotNet6_0.verified.txt | 1 - ...SchemaFilter_i=None.DotNet7_0.verified.txt | 1 - ...gerSchemaFilter_i=None.Net4_8.verified.txt | 1 - ..._c=SwaggerSchemaFilter_i=None.verified.txt | 1 - ...SystemTextJson_i=None.Core3_1.verified.txt | 1 - ...stemTextJson_i=None.DotNet6_0.verified.txt | 1 - ...stemTextJson_i=None.DotNet7_0.verified.txt | 1 - ...=SystemTextJson_i=None.Net4_8.verified.txt | 1 - ...=Guid_c=SystemTextJson_i=None.verified.txt | 1 - ...=TypeConverter_i=None.Core3_1.verified.txt | 1 - ...ypeConverter_i=None.DotNet6_0.verified.txt | 1 - ...ypeConverter_i=None.DotNet7_0.verified.txt | 1 - ...c=TypeConverter_i=None.Net4_8.verified.txt | 1 - ...e=Guid_c=TypeConverter_i=None.verified.txt | 1 - ...perTypeHandler_i=None.Core3_1.verified.txt | 1 + ...rTypeHandler_i=None.DotNet6_0.verified.txt | 1 + ...rTypeHandler_i=None.DotNet7_0.verified.txt | 1 + ...pperTypeHandler_i=None.Net4_8.verified.txt | 1 + ...nt_c=DapperTypeHandler_i=None.verified.txt | 1 + ...ValueConverter_i=None.Core3_1.verified.txt | 1 + ...lueConverter_i=None.DotNet6_0.verified.txt | 1 + ...lueConverter_i=None.DotNet7_0.verified.txt | 1 + ...eValueConverter_i=None.Net4_8.verified.txt | 1 + ...c=EfCoreValueConverter_i=None.verified.txt | 1 + ...NewtonsoftJson_i=None.Core3_1.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet6_0.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet7_0.verified.txt | 1 + ...=NewtonsoftJson_i=None.Net4_8.verified.txt | 1 + ...e=Int_c=NewtonsoftJson_i=None.verified.txt | 1 + ..._c=None_i=IComparable.Core3_1.verified.txt | 1 + ...=None_i=IComparable.DotNet6_0.verified.txt | 1 + ...=None_i=IComparable.DotNet7_0.verified.txt | 1 + ...t_c=None_i=IComparable.Net4_8.verified.txt | 1 + ...type=Int_c=None_i=IComparable.verified.txt | 1 + ...c=None_i=IConvertible.Core3_1.verified.txt | 126 ++++++++++++++++ ...None_i=IConvertible.DotNet6_0.verified.txt | 126 ++++++++++++++++ ...None_i=IConvertible.DotNet7_0.verified.txt | 126 ++++++++++++++++ ..._c=None_i=IConvertible.Net4_8.verified.txt | 126 ++++++++++++++++ ...ype=Int_c=None_i=IConvertible.verified.txt | 126 ++++++++++++++++ ...t_c=None_i=IEquatable.Core3_1.verified.txt | 1 + ...c=None_i=IEquatable.DotNet6_0.verified.txt | 1 + ...c=None_i=IEquatable.DotNet7_0.verified.txt | 1 + ...nt_c=None_i=IEquatable.Net4_8.verified.txt | 1 + ..._type=Int_c=None_i=IEquatable.verified.txt | 1 + ...nt_c=None_i=IParsable.Core3_1.verified.txt | 1 + ..._c=None_i=IParsable.DotNet6_0.verified.txt | 1 + ..._c=None_i=IParsable.DotNet7_0.verified.txt | 1 + ...Int_c=None_i=IParsable.Net4_8.verified.txt | 1 + ...y_type=Int_c=None_i=IParsable.verified.txt | 1 + ...ne_i=IStronglyTypedId.Core3_1.verified.txt | 42 ++++++ ..._i=IStronglyTypedId.DotNet6_0.verified.txt | 42 ++++++ ..._i=IStronglyTypedId.DotNet7_0.verified.txt | 42 ++++++ ...one_i=IStronglyTypedId.Net4_8.verified.txt | 42 ++++++ ...Int_c=None_i=IStronglyTypedId.verified.txt | 42 ++++++ ...ype=Int_c=None_i=None.Core3_1.verified.txt | 1 + ...e=Int_c=None_i=None.DotNet6_0.verified.txt | 1 + ...e=Int_c=None_i=None.DotNet7_0.verified.txt | 1 + ...type=Int_c=None_i=None.Net4_8.verified.txt | 1 + ...rectly_type=Int_c=None_i=None.verified.txt | 1 + ...erSchemaFilter_i=None.Core3_1.verified.txt | 1 + ...SchemaFilter_i=None.DotNet6_0.verified.txt | 1 + ...SchemaFilter_i=None.DotNet7_0.verified.txt | 1 + ...gerSchemaFilter_i=None.Net4_8.verified.txt | 1 + ..._c=SwaggerSchemaFilter_i=None.verified.txt | 1 + ...SystemTextJson_i=None.Core3_1.verified.txt | 1 + ...stemTextJson_i=None.DotNet6_0.verified.txt | 1 + ...stemTextJson_i=None.DotNet7_0.verified.txt | 1 + ...=SystemTextJson_i=None.Net4_8.verified.txt | 1 + ...e=Int_c=SystemTextJson_i=None.verified.txt | 1 + ...=TypeConverter_i=None.Core3_1.verified.txt | 1 + ...ypeConverter_i=None.DotNet6_0.verified.txt | 1 + ...ypeConverter_i=None.DotNet7_0.verified.txt | 1 + ...c=TypeConverter_i=None.Net4_8.verified.txt | 1 + ...pe=Int_c=TypeConverter_i=None.verified.txt | 1 + ...perTypeHandler_i=None.Core3_1.verified.txt | 1 + ...rTypeHandler_i=None.DotNet6_0.verified.txt | 1 + ...rTypeHandler_i=None.DotNet7_0.verified.txt | 1 + ...pperTypeHandler_i=None.Net4_8.verified.txt | 1 + ...ng_c=DapperTypeHandler_i=None.verified.txt | 1 + ...ValueConverter_i=None.Core3_1.verified.txt | 1 + ...lueConverter_i=None.DotNet6_0.verified.txt | 1 + ...lueConverter_i=None.DotNet7_0.verified.txt | 1 + ...eValueConverter_i=None.Net4_8.verified.txt | 1 + ...c=EfCoreValueConverter_i=None.verified.txt | 1 + ...NewtonsoftJson_i=None.Core3_1.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet6_0.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet7_0.verified.txt | 1 + ...=NewtonsoftJson_i=None.Net4_8.verified.txt | 1 + ...=Long_c=NewtonsoftJson_i=None.verified.txt | 1 + ..._c=None_i=IComparable.Core3_1.verified.txt | 1 + ...=None_i=IComparable.DotNet6_0.verified.txt | 1 + ...=None_i=IComparable.DotNet7_0.verified.txt | 1 + ...g_c=None_i=IComparable.Net4_8.verified.txt | 1 + ...ype=Long_c=None_i=IComparable.verified.txt | 1 + ...c=None_i=IConvertible.Core3_1.verified.txt | 126 ++++++++++++++++ ...None_i=IConvertible.DotNet6_0.verified.txt | 126 ++++++++++++++++ ...None_i=IConvertible.DotNet7_0.verified.txt | 126 ++++++++++++++++ ..._c=None_i=IConvertible.Net4_8.verified.txt | 126 ++++++++++++++++ ...pe=Long_c=None_i=IConvertible.verified.txt | 126 ++++++++++++++++ ...g_c=None_i=IEquatable.Core3_1.verified.txt | 1 + ...c=None_i=IEquatable.DotNet6_0.verified.txt | 1 + ...c=None_i=IEquatable.DotNet7_0.verified.txt | 1 + ...ng_c=None_i=IEquatable.Net4_8.verified.txt | 1 + ...type=Long_c=None_i=IEquatable.verified.txt | 1 + ...ng_c=None_i=IParsable.Core3_1.verified.txt | 1 + ..._c=None_i=IParsable.DotNet6_0.verified.txt | 1 + ..._c=None_i=IParsable.DotNet7_0.verified.txt | 1 + ...ong_c=None_i=IParsable.Net4_8.verified.txt | 1 + ..._type=Long_c=None_i=IParsable.verified.txt | 1 + ...ne_i=IStronglyTypedId.Core3_1.verified.txt | 42 ++++++ ..._i=IStronglyTypedId.DotNet6_0.verified.txt | 42 ++++++ ..._i=IStronglyTypedId.DotNet7_0.verified.txt | 42 ++++++ ...one_i=IStronglyTypedId.Net4_8.verified.txt | 42 ++++++ ...ong_c=None_i=IStronglyTypedId.verified.txt | 42 ++++++ ...pe=Long_c=None_i=None.Core3_1.verified.txt | 1 + ...=Long_c=None_i=None.DotNet6_0.verified.txt | 1 + ...=Long_c=None_i=None.DotNet7_0.verified.txt | 1 + ...ype=Long_c=None_i=None.Net4_8.verified.txt | 1 + ...ectly_type=Long_c=None_i=None.verified.txt | 1 + ...erSchemaFilter_i=None.Core3_1.verified.txt | 1 + ...SchemaFilter_i=None.DotNet6_0.verified.txt | 1 + ...SchemaFilter_i=None.DotNet7_0.verified.txt | 1 + ...gerSchemaFilter_i=None.Net4_8.verified.txt | 1 + ..._c=SwaggerSchemaFilter_i=None.verified.txt | 1 + ...SystemTextJson_i=None.Core3_1.verified.txt | 1 + ...stemTextJson_i=None.DotNet6_0.verified.txt | 1 + ...stemTextJson_i=None.DotNet7_0.verified.txt | 1 + ...=SystemTextJson_i=None.Net4_8.verified.txt | 1 + ...=Long_c=SystemTextJson_i=None.verified.txt | 1 + ...=TypeConverter_i=None.Core3_1.verified.txt | 1 + ...ypeConverter_i=None.DotNet6_0.verified.txt | 1 + ...ypeConverter_i=None.DotNet7_0.verified.txt | 1 + ...c=TypeConverter_i=None.Net4_8.verified.txt | 1 + ...e=Long_c=TypeConverter_i=None.verified.txt | 1 + ...perTypeHandler_i=None.Core3_1.verified.txt | 1 + ...rTypeHandler_i=None.DotNet6_0.verified.txt | 1 + ...rTypeHandler_i=None.DotNet7_0.verified.txt | 1 + ...pperTypeHandler_i=None.Net4_8.verified.txt | 1 + ...Id_c=DapperTypeHandler_i=None.verified.txt | 1 + ...ValueConverter_i=None.Core3_1.verified.txt | 1 + ...lueConverter_i=None.DotNet6_0.verified.txt | 1 + ...lueConverter_i=None.DotNet7_0.verified.txt | 1 + ...eValueConverter_i=None.Net4_8.verified.txt | 1 + ...c=EfCoreValueConverter_i=None.verified.txt | 1 + ...NewtonsoftJson_i=None.Core3_1.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet6_0.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet7_0.verified.txt | 1 + ...=NewtonsoftJson_i=None.Net4_8.verified.txt | 1 + ...NewId_c=NewtonsoftJson_i=None.verified.txt | 1 + ..._c=None_i=IComparable.Core3_1.verified.txt | 1 + ...=None_i=IComparable.DotNet6_0.verified.txt | 1 + ...=None_i=IComparable.DotNet7_0.verified.txt | 1 + ...d_c=None_i=IComparable.Net4_8.verified.txt | 1 + ...sitNewId_c=None_i=IComparable.verified.txt | 1 + ...c=None_i=IConvertible.Core3_1.verified.txt | 127 ++++++++++++++++ ...None_i=IConvertible.DotNet6_0.verified.txt | 127 ++++++++++++++++ ...None_i=IConvertible.DotNet7_0.verified.txt | 127 ++++++++++++++++ ..._c=None_i=IConvertible.Net4_8.verified.txt | 127 ++++++++++++++++ ...itNewId_c=None_i=IConvertible.verified.txt | 127 ++++++++++++++++ ...d_c=None_i=IEquatable.Core3_1.verified.txt | 1 + ...c=None_i=IEquatable.DotNet6_0.verified.txt | 1 + ...c=None_i=IEquatable.DotNet7_0.verified.txt | 1 + ...Id_c=None_i=IEquatable.Net4_8.verified.txt | 1 + ...nsitNewId_c=None_i=IEquatable.verified.txt | 1 + ...Id_c=None_i=IParsable.Core3_1.verified.txt | 1 + ..._c=None_i=IParsable.DotNet6_0.verified.txt | 1 + ..._c=None_i=IParsable.DotNet7_0.verified.txt | 1 + ...wId_c=None_i=IParsable.Net4_8.verified.txt | 1 + ...ansitNewId_c=None_i=IParsable.verified.txt | 1 + ...ne_i=IStronglyTypedId.Core3_1.verified.txt | 43 ++++++ ..._i=IStronglyTypedId.DotNet6_0.verified.txt | 43 ++++++ ..._i=IStronglyTypedId.DotNet7_0.verified.txt | 43 ++++++ ...one_i=IStronglyTypedId.Net4_8.verified.txt | 43 ++++++ ...wId_c=None_i=IStronglyTypedId.verified.txt | 43 ++++++ ...itNewId_c=None_i=None.Core3_1.verified.txt | 1 + ...NewId_c=None_i=None.DotNet6_0.verified.txt | 1 + ...NewId_c=None_i=None.DotNet7_0.verified.txt | 1 + ...sitNewId_c=None_i=None.Net4_8.verified.txt | 1 + ...assTransitNewId_c=None_i=None.verified.txt | 1 + ...erSchemaFilter_i=None.Core3_1.verified.txt | 1 + ...SchemaFilter_i=None.DotNet6_0.verified.txt | 1 + ...SchemaFilter_i=None.DotNet7_0.verified.txt | 1 + ...gerSchemaFilter_i=None.Net4_8.verified.txt | 1 + ..._c=SwaggerSchemaFilter_i=None.verified.txt | 1 + ...SystemTextJson_i=None.Core3_1.verified.txt | 1 + ...stemTextJson_i=None.DotNet6_0.verified.txt | 1 + ...stemTextJson_i=None.DotNet7_0.verified.txt | 1 + ...=SystemTextJson_i=None.Net4_8.verified.txt | 1 + ...NewId_c=SystemTextJson_i=None.verified.txt | 1 + ...=TypeConverter_i=None.Core3_1.verified.txt | 1 + ...ypeConverter_i=None.DotNet6_0.verified.txt | 1 + ...ypeConverter_i=None.DotNet7_0.verified.txt | 1 + ...c=TypeConverter_i=None.Net4_8.verified.txt | 1 + ...tNewId_c=TypeConverter_i=None.verified.txt | 1 + ...perTypeHandler_i=None.Core3_1.verified.txt | 1 + ...rTypeHandler_i=None.DotNet6_0.verified.txt | 1 + ...rTypeHandler_i=None.DotNet7_0.verified.txt | 1 + ...pperTypeHandler_i=None.Net4_8.verified.txt | 1 + ...ng_c=DapperTypeHandler_i=None.verified.txt | 1 + ...ValueConverter_i=None.Core3_1.verified.txt | 1 + ...lueConverter_i=None.DotNet6_0.verified.txt | 1 + ...lueConverter_i=None.DotNet7_0.verified.txt | 1 + ...eValueConverter_i=None.Net4_8.verified.txt | 1 + ...c=EfCoreValueConverter_i=None.verified.txt | 1 + ...NewtonsoftJson_i=None.Core3_1.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet6_0.verified.txt | 1 + ...wtonsoftJson_i=None.DotNet7_0.verified.txt | 1 + ...=NewtonsoftJson_i=None.Net4_8.verified.txt | 1 + ...tring_c=NewtonsoftJson_i=None.verified.txt | 1 + ..._c=None_i=IComparable.Core3_1.verified.txt | 1 + ...=None_i=IComparable.DotNet6_0.verified.txt | 1 + ...=None_i=IComparable.DotNet7_0.verified.txt | 1 + ...g_c=None_i=IComparable.Net4_8.verified.txt | 1 + ...leString_c=None_i=IComparable.verified.txt | 1 + ...c=None_i=IConvertible.Core3_1.verified.txt | 135 ++++++++++++++++++ ...None_i=IConvertible.DotNet6_0.verified.txt | 135 ++++++++++++++++++ ...None_i=IConvertible.DotNet7_0.verified.txt | 135 ++++++++++++++++++ ..._c=None_i=IConvertible.Net4_8.verified.txt | 135 ++++++++++++++++++ ...eString_c=None_i=IConvertible.verified.txt | 135 ++++++++++++++++++ ...g_c=None_i=IEquatable.Core3_1.verified.txt | 1 + ...c=None_i=IEquatable.DotNet6_0.verified.txt | 1 + ...c=None_i=IEquatable.DotNet7_0.verified.txt | 1 + ...ng_c=None_i=IEquatable.Net4_8.verified.txt | 1 + ...bleString_c=None_i=IEquatable.verified.txt | 1 + ...ng_c=None_i=IParsable.Core3_1.verified.txt | 1 + ..._c=None_i=IParsable.DotNet6_0.verified.txt | 1 + ..._c=None_i=IParsable.DotNet7_0.verified.txt | 1 + ...ing_c=None_i=IParsable.Net4_8.verified.txt | 1 + ...ableString_c=None_i=IParsable.verified.txt | 1 + ...ne_i=IStronglyTypedId.Core3_1.verified.txt | 51 +++++++ ..._i=IStronglyTypedId.DotNet6_0.verified.txt | 51 +++++++ ..._i=IStronglyTypedId.DotNet7_0.verified.txt | 51 +++++++ ...one_i=IStronglyTypedId.Net4_8.verified.txt | 51 +++++++ ...ing_c=None_i=IStronglyTypedId.verified.txt | 51 +++++++ ...eString_c=None_i=None.Core3_1.verified.txt | 1 + ...tring_c=None_i=None.DotNet6_0.verified.txt | 1 + ...tring_c=None_i=None.DotNet7_0.verified.txt | 1 + ...leString_c=None_i=None.Net4_8.verified.txt | 1 + ...=NullableString_c=None_i=None.verified.txt | 1 + ...erSchemaFilter_i=None.Core3_1.verified.txt | 1 + ...SchemaFilter_i=None.DotNet6_0.verified.txt | 1 + ...SchemaFilter_i=None.DotNet7_0.verified.txt | 1 + ...gerSchemaFilter_i=None.Net4_8.verified.txt | 1 + ..._c=SwaggerSchemaFilter_i=None.verified.txt | 1 + ...SystemTextJson_i=None.Core3_1.verified.txt | 1 + ...stemTextJson_i=None.DotNet6_0.verified.txt | 1 + ...stemTextJson_i=None.DotNet7_0.verified.txt | 1 + ...=SystemTextJson_i=None.Net4_8.verified.txt | 1 + ...tring_c=SystemTextJson_i=None.verified.txt | 1 + ...=TypeConverter_i=None.Core3_1.verified.txt | 1 + ...ypeConverter_i=None.DotNet6_0.verified.txt | 1 + ...ypeConverter_i=None.DotNet7_0.verified.txt | 1 + ...c=TypeConverter_i=None.Net4_8.verified.txt | 1 + ...String_c=TypeConverter_i=None.verified.txt | 1 + ...c=None_i=IConvertible.Core3_1.verified.txt | 134 +++++++++++++++++ ...None_i=IConvertible.DotNet6_0.verified.txt | 134 +++++++++++++++++ ...None_i=IConvertible.DotNet7_0.verified.txt | 134 +++++++++++++++++ ..._c=None_i=IConvertible.Net4_8.verified.txt | 134 +++++++++++++++++ ...=String_c=None_i=IConvertible.verified.txt | 134 +++++++++++++++++ ...ne_i=IStronglyTypedId.Core3_1.verified.txt | 50 +++++++ ..._i=IStronglyTypedId.DotNet6_0.verified.txt | 50 +++++++ ..._i=IStronglyTypedId.DotNet7_0.verified.txt | 50 +++++++ ...one_i=IStronglyTypedId.Net4_8.verified.txt | 50 +++++++ ...ing_c=None_i=IStronglyTypedId.verified.txt | 50 +++++++ ...ly_nestedClassCount=0.Core3_1.verified.txt | 1 - ..._nestedClassCount=0.DotNet6_0.verified.txt | 1 - ..._nestedClassCount=0.DotNet7_0.verified.txt | 1 - ...tly_nestedClassCount=0.Net4_8.verified.txt | 1 - ...sCorrectly_nestedClassCount=0.verified.txt | 1 - ...ly_nestedClassCount=1.Core3_1.verified.txt | 1 - ..._nestedClassCount=1.DotNet6_0.verified.txt | 1 - ..._nestedClassCount=1.DotNet7_0.verified.txt | 1 - ...tly_nestedClassCount=1.Net4_8.verified.txt | 1 - ...sCorrectly_nestedClassCount=1.verified.txt | 1 - ...ly_nestedClassCount=2.Core3_1.verified.txt | 1 - ..._nestedClassCount=2.DotNet6_0.verified.txt | 1 - ..._nestedClassCount=2.DotNet7_0.verified.txt | 1 - ...tly_nestedClassCount=2.Net4_8.verified.txt | 1 - ...sCorrectly_nestedClassCount=2.verified.txt | 1 - ...ltIdInGlobalNamespace.Core3_1.verified.txt | 17 ++- ...IdInGlobalNamespace.DotNet6_0.verified.txt | 17 ++- ...IdInGlobalNamespace.DotNet7_0.verified.txt | 17 ++- ...ultIdInGlobalNamespace.Net4_8.verified.txt | 17 ++- ...ateDefaultIdInGlobalNamespace.verified.txt | 17 ++- ...InFileScopedNamespace.Core3_1.verified.txt | 17 ++- ...FileScopedNamespace.DotNet6_0.verified.txt | 17 ++- ...FileScopedNamespace.DotNet7_0.verified.txt | 17 ++- ...dInFileScopedNamespace.Net4_8.verified.txt | 17 ++- ...nerateIdInFileScopedNamespace.verified.txt | 17 ++- ...GenerateIdInNamespace.Core3_1.verified.txt | 17 ++- ...nerateIdInNamespace.DotNet6_0.verified.txt | 17 ++- ...nerateIdInNamespace.DotNet7_0.verified.txt | 17 ++- ...nGenerateIdInNamespace.Net4_8.verified.txt | 17 ++- ...ests.CanGenerateIdInNamespace.verified.txt | 17 ++- ...tJson, SystemTextJson.Core3_1.verified.txt | 17 ++- ...son, SystemTextJson.DotNet6_0.verified.txt | 17 ++- ...son, SystemTextJson.DotNet7_0.verified.txt | 17 ++- ...ftJson, SystemTextJson.Net4_8.verified.txt | 17 ++- ...ewtonsoftJson, SystemTextJson.verified.txt | 17 ++- ...verter=NewtonsoftJson.Core3_1.verified.txt | 17 ++- ...rter=NewtonsoftJson.DotNet6_0.verified.txt | 17 ++- ...rter=NewtonsoftJson.DotNet7_0.verified.txt | 17 ++- ...nverter=NewtonsoftJson.Net4_8.verified.txt | 17 ++- ...Guid_converter=NewtonsoftJson.verified.txt | 17 ++- ...verter=SystemTextJson.Core3_1.verified.txt | 17 ++- ...rter=SystemTextJson.DotNet6_0.verified.txt | 17 ++- ...rter=SystemTextJson.DotNet7_0.verified.txt | 17 ++- ...nverter=SystemTextJson.Net4_8.verified.txt | 17 ++- ...Guid_converter=SystemTextJson.verified.txt | 17 ++- ...nverter=TypeConverter.Core3_1.verified.txt | 17 ++- ...erter=TypeConverter.DotNet6_0.verified.txt | 17 ++- ...erter=TypeConverter.DotNet7_0.verified.txt | 17 ++- ...onverter=TypeConverter.Net4_8.verified.txt | 17 ++- ...=Guid_converter=TypeConverter.verified.txt | 17 ++- ...e=Guid_converter=null.Core3_1.verified.txt | 17 ++- ...Guid_converter=null.DotNet6_0.verified.txt | 17 ++- ...Guid_converter=null.DotNet7_0.verified.txt | 17 ++- ...pe=Guid_converter=null.Net4_8.verified.txt | 17 ++- ...ckingType=Guid_converter=null.verified.txt | 17 ++- ...tJson, SystemTextJson.Core3_1.verified.txt | 17 ++- ...son, SystemTextJson.DotNet6_0.verified.txt | 17 ++- ...son, SystemTextJson.DotNet7_0.verified.txt | 17 ++- ...ftJson, SystemTextJson.Net4_8.verified.txt | 17 ++- ...ewtonsoftJson, SystemTextJson.verified.txt | 17 ++- ...verter=NewtonsoftJson.Core3_1.verified.txt | 17 ++- ...rter=NewtonsoftJson.DotNet6_0.verified.txt | 17 ++- ...rter=NewtonsoftJson.DotNet7_0.verified.txt | 17 ++- ...nverter=NewtonsoftJson.Net4_8.verified.txt | 17 ++- ...Guid_converter=NewtonsoftJson.verified.txt | 17 ++- ...verter=SystemTextJson.Core3_1.verified.txt | 17 ++- ...rter=SystemTextJson.DotNet6_0.verified.txt | 17 ++- ...rter=SystemTextJson.DotNet7_0.verified.txt | 17 ++- ...nverter=SystemTextJson.Net4_8.verified.txt | 17 ++- ...Guid_converter=SystemTextJson.verified.txt | 17 ++- ...nverter=TypeConverter.Core3_1.verified.txt | 17 ++- ...erter=TypeConverter.DotNet6_0.verified.txt | 17 ++- ...erter=TypeConverter.DotNet7_0.verified.txt | 17 ++- ...onverter=TypeConverter.Net4_8.verified.txt | 17 ++- ...=Guid_converter=TypeConverter.verified.txt | 17 ++- ...e=Guid_converter=null.Core3_1.verified.txt | 17 ++- ...Guid_converter=null.DotNet6_0.verified.txt | 17 ++- ...Guid_converter=null.DotNet7_0.verified.txt | 17 ++- ...pe=Guid_converter=null.Net4_8.verified.txt | 17 ++- ...ckingType=Guid_converter=null.verified.txt | 17 ++- ...ltipleIdsWithSameName.Core3_1.verified.txt | 18 ++- ...ipleIdsWithSameName.DotNet6_0.verified.txt | 18 ++- ...ipleIdsWithSameName.DotNet7_0.verified.txt | 18 ++- ...ultipleIdsWithSameName.Net4_8.verified.txt | 18 ++- ...nerateMultipleIdsWithSameName.verified.txt | 18 ++- ...dInFileScopeNamespace.Core3_1.verified.txt | 17 ++- ...nFileScopeNamespace.DotNet6_0.verified.txt | 17 ++- ...nFileScopeNamespace.DotNet7_0.verified.txt | 17 ++- ...IdInFileScopeNamespace.Net4_8.verified.txt | 17 ++- ...eNestedIdInFileScopeNamespace.verified.txt | 17 ++- ...dInFileScopeNamespace.Core3_1.verified.txt | 17 ++- ...nFileScopeNamespace.DotNet6_0.verified.txt | 17 ++- ...nFileScopeNamespace.DotNet7_0.verified.txt | 17 ++- ...IdInFileScopeNamespace.Net4_8.verified.txt | 17 ++- ...yNestedIdInFileScopeNamespace.verified.txt | 17 ++- ...sUsingGlobalAttribute.Core3_1.verified.txt | 17 ++- ...singGlobalAttribute.DotNet6_0.verified.txt | 17 ++- ...singGlobalAttribute.DotNet7_0.verified.txt | 17 ++- ...tsUsingGlobalAttribute.Net4_8.verified.txt | 17 ++- ...eDefaultsUsingGlobalAttribute.verified.txt | 17 ++- .../StronglyTypedIds.Tests/StronglyTypedId.cs | 2 + version.props | 2 +- 472 files changed, 10262 insertions(+), 376 deletions(-) create mode 100644 src/StronglyTypedIds/Templates/Guid/Guid_Convertible.cs create mode 100644 src/StronglyTypedIds/Templates/Guid/Guid_StronglyTypedId.cs create mode 100644 src/StronglyTypedIds/Templates/Int/Int_Convertible.cs create mode 100644 src/StronglyTypedIds/Templates/Int/Int_StronglyTypedId.cs create mode 100644 src/StronglyTypedIds/Templates/Long/Long_Convertible.cs create mode 100644 src/StronglyTypedIds/Templates/Long/Long_StronglyTypedId.cs create mode 100644 src/StronglyTypedIds/Templates/NewId/NewId_Convertible.cs create mode 100644 src/StronglyTypedIds/Templates/NewId/NewId_StronglyTypedId.cs create mode 100644 src/StronglyTypedIds/Templates/NullableString/NullableString_Convertible.cs create mode 100644 src/StronglyTypedIds/Templates/NullableString/NullableString_StronglyTypedId.cs create mode 100644 src/StronglyTypedIds/Templates/String/String_Convertible.cs create mode 100644 src/StronglyTypedIds/Templates/String/String_StronglyTypedId.cs create mode 100644 test/StronglyTypedIds.IntegrationTests/StronglyTypedId.cs create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Core3_1.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Net4_8.verified.txt create mode 100644 test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.verified.txt create mode 100644 test/StronglyTypedIds.Tests/StronglyTypedId.cs diff --git a/src/StronglyTypedIds.Attributes/StronglyTypedIdImplementations.cs b/src/StronglyTypedIds.Attributes/StronglyTypedIdImplementations.cs index b323f597a..5d145ccb1 100644 --- a/src/StronglyTypedIds.Attributes/StronglyTypedIdImplementations.cs +++ b/src/StronglyTypedIds.Attributes/StronglyTypedIdImplementations.cs @@ -36,8 +36,20 @@ public enum StronglyTypedIdImplementations // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } diff --git a/src/StronglyTypedIds/EmbeddedSources.cs b/src/StronglyTypedIds/EmbeddedSources.cs index bcd8f008a..acaade238 100644 --- a/src/StronglyTypedIds/EmbeddedSources.cs +++ b/src/StronglyTypedIds/EmbeddedSources.cs @@ -26,6 +26,8 @@ internal static class EmbeddedSources LoadEmbeddedResource("StronglyTypedIds.Templates.Guid.Guid_DapperTypeHandler.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Guid.Guid_IComparable.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Guid.Guid_Parsable.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.Guid.Guid_Convertible.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.Guid.Guid_StronglyTypedId.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Guid.Guid_SwaggerSchemaFilter.cs"), false ); @@ -40,6 +42,8 @@ internal static class EmbeddedSources LoadEmbeddedResource("StronglyTypedIds.Templates.Int.Int_DapperTypeHandler.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Int.Int_IComparable.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Int.Int_Parsable.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.Int.Int_Convertible.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.Int.Int_StronglyTypedId.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Int.Int_SwaggerSchemaFilter.cs"), false ); @@ -54,6 +58,8 @@ internal static class EmbeddedSources LoadEmbeddedResource("StronglyTypedIds.Templates.Long.Long_DapperTypeHandler.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Long.Long_IComparable.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Long.Long_Parsable.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.Long.Long_Convertible.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.Long.Long_StronglyTypedId.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.Long.Long_SwaggerSchemaFilter.cs"), false ); @@ -68,6 +74,8 @@ internal static class EmbeddedSources LoadEmbeddedResource("StronglyTypedIds.Templates.String.String_DapperTypeHandler.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.String.String_IComparable.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.String.String_Parsable.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.String.String_Convertible.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.String.String_StronglyTypedId.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.String.String_SwaggerSchemaFilter.cs"), false ); @@ -82,6 +90,8 @@ internal static class EmbeddedSources LoadEmbeddedResource("StronglyTypedIds.Templates.NullableString.NullableString_DapperTypeHandler.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.NullableString.NullableString_IComparable.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.NullableString.NullableString_Parsable.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.NullableString.NullableString_Convertible.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.NullableString.NullableString_StronglyTypedId.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.NullableString.NullableString_SwaggerSchemaFilter.cs"), true ); @@ -96,6 +106,8 @@ internal static class EmbeddedSources LoadEmbeddedResource("StronglyTypedIds.Templates.NewId.NewId_DapperTypeHandler.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.NewId.NewId_IComparable.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.NewId.NewId_Parsable.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.NewId.NewId_Convertible.cs"), + LoadEmbeddedResource("StronglyTypedIds.Templates.NewId.NewId_StronglyTypedId.cs"), LoadEmbeddedResource("StronglyTypedIds.Templates.NewId.NewId_SwaggerSchemaFilter.cs"), false ); @@ -132,6 +144,9 @@ public readonly struct ResourceCollection public string DapperTypeHandler { get; } public string Comparable { get; } public string Parsable { get; } + public string Convertible { get; } + + public string StronglyTypedId { get; } public ResourceCollection( string header, @@ -143,6 +158,8 @@ public ResourceCollection( string dapperTypeHandler, string comparable, string parsable, + string convertible, + string stronglyTypedId, string swaggerSchemaFilter, bool nullableEnable) { @@ -155,7 +172,9 @@ public ResourceCollection( DapperTypeHandler = dapperTypeHandler; Comparable = comparable; Parsable = parsable; + Convertible = convertible; NullableEnable = nullableEnable; + StronglyTypedId = stronglyTypedId; Header = header; } } diff --git a/src/StronglyTypedIds/ParentClass.cs b/src/StronglyTypedIds/ParentClass.cs index 012c41274..093c7c0fb 100644 --- a/src/StronglyTypedIds/ParentClass.cs +++ b/src/StronglyTypedIds/ParentClass.cs @@ -1,3 +1,5 @@ +using System; + namespace StronglyTypedIds; internal class ParentClass @@ -14,4 +16,4 @@ public ParentClass(string keyword, string name, string constraints, ParentClass? public string Keyword { get; } public string Name { get; } public string Constraints { get; } -} \ No newline at end of file +} diff --git a/src/StronglyTypedIds/SourceGenerationHelper.cs b/src/StronglyTypedIds/SourceGenerationHelper.cs index 265225909..e9474f5d6 100644 --- a/src/StronglyTypedIds/SourceGenerationHelper.cs +++ b/src/StronglyTypedIds/SourceGenerationHelper.cs @@ -35,7 +35,7 @@ public static string CreateId( _ => throw new ArgumentException("Unknown backing type: " + backingType, nameof(backingType)), }; - return CreateId(idNamespace, idName, parentClass, converters, implementations, resources, sb); + return CreateId(idNamespace, idName, parentClass, converters, implementations, resources,backingType, sb); } static string CreateId( @@ -45,6 +45,7 @@ static string CreateId( StronglyTypedIdConverter converters, StronglyTypedIdImplementations implementations, EmbeddedSources.ResourceCollection resources, + StronglyTypedIdBackingType backingType, StringBuilder? sb) { if (string.IsNullOrEmpty(idName)) @@ -74,6 +75,8 @@ static string CreateId( var useIEquatable = implementations.IsSet(StronglyTypedIdImplementations.IEquatable); var useIComparable = implementations.IsSet(StronglyTypedIdImplementations.IComparable); var useIParsable = implementations.IsSet(StronglyTypedIdImplementations.IParsable); + var useIConvertible = implementations.IsSet(StronglyTypedIdImplementations.IConvertible); + var useIStronglyTypedId = implementations.IsSet(StronglyTypedIdImplementations.IStronglyTypedId); var parentsCount = 0; @@ -131,7 +134,7 @@ static string CreateId( sb.Append(resources.BaseId); - ReplaceInterfaces(sb, useIEquatable, useIComparable, useIParsable); + ReplaceInterfaces(sb, useIEquatable, useIComparable, useIParsable, useIConvertible, useIStronglyTypedId, backingType); // IEquatable is already implemented whether or not the interface is implemented @@ -145,6 +148,16 @@ static string CreateId( sb.AppendLine(resources.Parsable); } + if (useIConvertible) + { + sb.AppendLine(resources.Convertible); + } + + if (useIStronglyTypedId) + { + sb.AppendLine(resources.StronglyTypedId); + } + if (useEfCoreValueConverter) { sb.AppendLine(resources.EfCoreValueConverter); @@ -191,7 +204,23 @@ static string CreateId( return sb.ToString(); } - private static void ReplaceInterfaces(StringBuilder sb, bool useIEquatable, bool useIComparable, bool useIParsable) + + private static string BackingType(StronglyTypedIdBackingType backingType) + { + var resources = backingType switch + { + StronglyTypedIdBackingType.Guid => "System.Guid", + StronglyTypedIdBackingType.Int => "int", + StronglyTypedIdBackingType.Long => "long", + StronglyTypedIdBackingType.String => "string", + StronglyTypedIdBackingType.NullableString => "string?", + StronglyTypedIdBackingType.MassTransitNewId => "MassTransit.NewId", + _ => throw new ArgumentException("Unknown backing type: " + backingType, nameof(backingType)), + }; + return resources; + } + + private static void ReplaceInterfaces(StringBuilder sb, bool useIEquatable, bool useIComparable, bool useIParsable, bool useIConvertible, bool useIStronglyTypedId, StronglyTypedIdBackingType backingType) { var interfaces = new List(); @@ -210,6 +239,16 @@ private static void ReplaceInterfaces(StringBuilder sb, bool useIEquatable, bool interfaces.Add("System.IParsable"); } + if (useIConvertible) + { + interfaces.Add("System.IConvertible"); + } + + if (useIStronglyTypedId) + { + interfaces.Add($"IStronglyTypedId<{BackingType(backingType)}>"); + } + if (interfaces.Count > 0) { sb.Replace("INTERFACES", string.Join(", ", interfaces)); diff --git a/src/StronglyTypedIds/Templates/Guid/Guid_Base.cs b/src/StronglyTypedIds/Templates/Guid/Guid_Base.cs index 200147a15..324fda87a 100644 --- a/src/StronglyTypedIds/Templates/Guid/Guid_Base.cs +++ b/src/StronglyTypedIds/Templates/Guid/Guid_Base.cs @@ -16,7 +16,6 @@ public override bool Equals(object obj) if (ReferenceEquals(null, obj)) return false; return obj is TESTID other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/src/StronglyTypedIds/Templates/Guid/Guid_Convertible.cs b/src/StronglyTypedIds/Templates/Guid/Guid_Convertible.cs new file mode 100644 index 000000000..56e2b009d --- /dev/null +++ b/src/StronglyTypedIds/Templates/Guid/Guid_Convertible.cs @@ -0,0 +1,89 @@ + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable diff --git a/src/StronglyTypedIds/Templates/Guid/Guid_StronglyTypedId.cs b/src/StronglyTypedIds/Templates/Guid/Guid_StronglyTypedId.cs new file mode 100644 index 000000000..5f234d181 --- /dev/null +++ b/src/StronglyTypedIds/Templates/Guid/Guid_StronglyTypedId.cs @@ -0,0 +1,5 @@ + + public static IStronglyTypedId Create(System.Guid value) + { + return new TESTID(value); + } diff --git a/src/StronglyTypedIds/Templates/Int/Int_Base.cs b/src/StronglyTypedIds/Templates/Int/Int_Base.cs index 08ce1fca6..71535f568 100644 --- a/src/StronglyTypedIds/Templates/Int/Int_Base.cs +++ b/src/StronglyTypedIds/Templates/Int/Int_Base.cs @@ -19,5 +19,6 @@ public override bool Equals(object obj) public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(TESTID a, TESTID b) => a.Equals(b); public static bool operator !=(TESTID a, TESTID b) => !(a == b); diff --git a/src/StronglyTypedIds/Templates/Int/Int_Convertible.cs b/src/StronglyTypedIds/Templates/Int/Int_Convertible.cs new file mode 100644 index 000000000..699cd94e7 --- /dev/null +++ b/src/StronglyTypedIds/Templates/Int/Int_Convertible.cs @@ -0,0 +1,89 @@ + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable diff --git a/src/StronglyTypedIds/Templates/Int/Int_StronglyTypedId.cs b/src/StronglyTypedIds/Templates/Int/Int_StronglyTypedId.cs new file mode 100644 index 000000000..ba09088b8 --- /dev/null +++ b/src/StronglyTypedIds/Templates/Int/Int_StronglyTypedId.cs @@ -0,0 +1,5 @@ + + public static IStronglyTypedId Create(int value) + { + return new TESTID(value); + } diff --git a/src/StronglyTypedIds/Templates/Long/Long_Base.cs b/src/StronglyTypedIds/Templates/Long/Long_Base.cs index 38d9fc5a6..772634aba 100644 --- a/src/StronglyTypedIds/Templates/Long/Long_Base.cs +++ b/src/StronglyTypedIds/Templates/Long/Long_Base.cs @@ -19,5 +19,6 @@ public override bool Equals(object obj) public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(TESTID a, TESTID b) => a.Equals(b); public static bool operator !=(TESTID a, TESTID b) => !(a == b); diff --git a/src/StronglyTypedIds/Templates/Long/Long_Convertible.cs b/src/StronglyTypedIds/Templates/Long/Long_Convertible.cs new file mode 100644 index 000000000..5b176b826 --- /dev/null +++ b/src/StronglyTypedIds/Templates/Long/Long_Convertible.cs @@ -0,0 +1,89 @@ + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable diff --git a/src/StronglyTypedIds/Templates/Long/Long_StronglyTypedId.cs b/src/StronglyTypedIds/Templates/Long/Long_StronglyTypedId.cs new file mode 100644 index 000000000..e306b02be --- /dev/null +++ b/src/StronglyTypedIds/Templates/Long/Long_StronglyTypedId.cs @@ -0,0 +1,5 @@ + + public static IStronglyTypedId Create(long value) + { + return new TESTID(value); + } diff --git a/src/StronglyTypedIds/Templates/NewId/NewId_Base.cs b/src/StronglyTypedIds/Templates/NewId/NewId_Base.cs index 854cd477a..e7f3d668d 100644 --- a/src/StronglyTypedIds/Templates/NewId/NewId_Base.cs +++ b/src/StronglyTypedIds/Templates/NewId/NewId_Base.cs @@ -20,5 +20,6 @@ public override bool Equals(object obj) public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(TESTID a, TESTID b) => a.Equals(b); public static bool operator !=(TESTID a, TESTID b) => !(a == b); diff --git a/src/StronglyTypedIds/Templates/NewId/NewId_Convertible.cs b/src/StronglyTypedIds/Templates/NewId/NewId_Convertible.cs new file mode 100644 index 000000000..56e2b009d --- /dev/null +++ b/src/StronglyTypedIds/Templates/NewId/NewId_Convertible.cs @@ -0,0 +1,89 @@ + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable diff --git a/src/StronglyTypedIds/Templates/NewId/NewId_StronglyTypedId.cs b/src/StronglyTypedIds/Templates/NewId/NewId_StronglyTypedId.cs new file mode 100644 index 000000000..050a6d892 --- /dev/null +++ b/src/StronglyTypedIds/Templates/NewId/NewId_StronglyTypedId.cs @@ -0,0 +1,5 @@ + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new TESTID(value); + } diff --git a/src/StronglyTypedIds/Templates/NullableString/NullableString_Base.cs b/src/StronglyTypedIds/Templates/NullableString/NullableString_Base.cs index 94a6eaffb..7c91eed8e 100644 --- a/src/StronglyTypedIds/Templates/NullableString/NullableString_Base.cs +++ b/src/StronglyTypedIds/Templates/NullableString/NullableString_Base.cs @@ -27,5 +27,6 @@ public override bool Equals(object? obj) public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(TESTID a, TESTID b) => a.Equals(b); public static bool operator !=(TESTID a, TESTID b) => !(a == b); diff --git a/src/StronglyTypedIds/Templates/NullableString/NullableString_Convertible.cs b/src/StronglyTypedIds/Templates/NullableString/NullableString_Convertible.cs new file mode 100644 index 000000000..56e2b009d --- /dev/null +++ b/src/StronglyTypedIds/Templates/NullableString/NullableString_Convertible.cs @@ -0,0 +1,89 @@ + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable diff --git a/src/StronglyTypedIds/Templates/NullableString/NullableString_StronglyTypedId.cs b/src/StronglyTypedIds/Templates/NullableString/NullableString_StronglyTypedId.cs new file mode 100644 index 000000000..a347d496f --- /dev/null +++ b/src/StronglyTypedIds/Templates/NullableString/NullableString_StronglyTypedId.cs @@ -0,0 +1,5 @@ + + public static IStronglyTypedId Create(string? value) + { + return new TESTID(value); + } diff --git a/src/StronglyTypedIds/Templates/String/String_Convertible.cs b/src/StronglyTypedIds/Templates/String/String_Convertible.cs new file mode 100644 index 000000000..56e2b009d --- /dev/null +++ b/src/StronglyTypedIds/Templates/String/String_Convertible.cs @@ -0,0 +1,89 @@ + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable diff --git a/src/StronglyTypedIds/Templates/String/String_StronglyTypedId.cs b/src/StronglyTypedIds/Templates/String/String_StronglyTypedId.cs new file mode 100644 index 000000000..763971d65 --- /dev/null +++ b/src/StronglyTypedIds/Templates/String/String_StronglyTypedId.cs @@ -0,0 +1,5 @@ + + public static IStronglyTypedId Create(string value) + { + return new TESTID(value); + } diff --git a/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs b/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs index 404ca9257..1f7ad4064 100644 --- a/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs +++ b/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs @@ -371,4 +371,4 @@ public class EntityWithNullableId public NewtonsoftJsonLongId? Id { get; set; } } } -} \ No newline at end of file +} diff --git a/test/StronglyTypedIds.IntegrationTests/StronglyTypedId.cs b/test/StronglyTypedIds.IntegrationTests/StronglyTypedId.cs new file mode 100644 index 000000000..d59f89274 --- /dev/null +++ b/test/StronglyTypedIds.IntegrationTests/StronglyTypedId.cs @@ -0,0 +1,2 @@ +public interface IStronglyTypedId { +} diff --git a/test/StronglyTypedIds.IntegrationTests/Types/GuidId.cs b/test/StronglyTypedIds.IntegrationTests/Types/GuidId.cs index dcafd4207..bfefdc655 100644 --- a/test/StronglyTypedIds.IntegrationTests/Types/GuidId.cs +++ b/test/StronglyTypedIds.IntegrationTests/Types/GuidId.cs @@ -42,4 +42,4 @@ public partial struct EquatableGuidId { } [StronglyTypedId(implementations: StronglyTypedIdImplementations.IComparable)] public partial struct ComparableGuidId { } -} \ No newline at end of file +} diff --git a/test/StronglyTypedIds.IntegrationTests/Types/LongId.cs b/test/StronglyTypedIds.IntegrationTests/Types/LongId.cs index b3fcf5667..3c24c9944 100644 --- a/test/StronglyTypedIds.IntegrationTests/Types/LongId.cs +++ b/test/StronglyTypedIds.IntegrationTests/Types/LongId.cs @@ -39,4 +39,7 @@ public partial struct EquatableLongId { } [StronglyTypedId(backingType: StronglyTypedIdBackingType.Long, implementations: StronglyTypedIdImplementations.IComparable)] public partial struct ComparableLongId { } -} \ No newline at end of file + + [StronglyTypedId(backingType: StronglyTypedIdBackingType.Long, implementations: StronglyTypedIdImplementations.IStronglyTypedId)] + public partial struct StronglyTypedIdLongId { } +} diff --git a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Core3_1.verified.txt index 3eb5342b4..485917d76 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Core3_1.verified.txt @@ -49,9 +49,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet6_0.verified.txt index 3eb5342b4..485917d76 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet6_0.verified.txt @@ -49,9 +49,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet7_0.verified.txt index 3eb5342b4..485917d76 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.DotNet7_0.verified.txt @@ -49,9 +49,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Net4_8.verified.txt index 3eb5342b4..485917d76 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.Net4_8.verified.txt @@ -49,9 +49,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.verified.txt index 3eb5342b4..485917d76 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/EmbeddedResourceTests.EmittedResourceIsSameAsCompiledResource_resource=StronglyTypedIdImplementations.verified.txt @@ -49,9 +49,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Core3_1.verified.txt index 89476b7f6..0681b5f46 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Core3_1.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public System.Guid Value { get; } @@ -31,7 +31,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -55,6 +54,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet6_0.verified.txt index 89476b7f6..0681b5f46 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet6_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public System.Guid Value { get; } @@ -31,7 +31,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -55,6 +54,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet7_0.verified.txt index 89476b7f6..0681b5f46 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.DotNet7_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public System.Guid Value { get; } @@ -31,7 +31,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -55,6 +54,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Net4_8.verified.txt index 89476b7f6..0681b5f46 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.Net4_8.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public System.Guid Value { get; } @@ -31,7 +31,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -55,6 +54,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.verified.txt index 89476b7f6..0681b5f46 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Guid.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public System.Guid Value { get; } @@ -31,7 +31,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -55,6 +54,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Core3_1.verified.txt index 3cf96bb15..7fa52cd3e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Core3_1.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public int Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet6_0.verified.txt index 3cf96bb15..7fa52cd3e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet6_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public int Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet7_0.verified.txt index 3cf96bb15..7fa52cd3e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.DotNet7_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public int Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Net4_8.verified.txt index 3cf96bb15..7fa52cd3e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.Net4_8.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public int Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.verified.txt index 3cf96bb15..7fa52cd3e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Int.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public int Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Core3_1.verified.txt index e217428d4..69991d2d4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Core3_1.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public long Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet6_0.verified.txt index e217428d4..69991d2d4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet6_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public long Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet7_0.verified.txt index e217428d4..69991d2d4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.DotNet7_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public long Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Net4_8.verified.txt index e217428d4..69991d2d4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.Net4_8.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public long Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.verified.txt index e217428d4..69991d2d4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=Long.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public long Value { get; } @@ -34,6 +34,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -54,6 +55,102 @@ #nullable disable +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Core3_1.verified.txt index f4fb469e7..a8fec5626 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Core3_1.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public MassTransit.NewId Value { get; } @@ -35,6 +35,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -53,6 +54,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet6_0.verified.txt index f4fb469e7..a8fec5626 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet6_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public MassTransit.NewId Value { get; } @@ -35,6 +35,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -53,6 +54,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet7_0.verified.txt index f4fb469e7..a8fec5626 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.DotNet7_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public MassTransit.NewId Value { get; } @@ -35,6 +35,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -53,6 +54,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Net4_8.verified.txt index f4fb469e7..a8fec5626 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.Net4_8.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public MassTransit.NewId Value { get; } @@ -35,6 +35,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -53,6 +54,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.verified.txt index f4fb469e7..a8fec5626 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=MassTransitNewId.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public MassTransit.NewId Value { get; } @@ -35,6 +35,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); @@ -53,6 +54,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Core3_1.verified.txt index 616270eaa..e49261d9a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Core3_1.verified.txt @@ -14,7 +14,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string? Value { get; } @@ -43,6 +43,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) @@ -68,6 +69,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet6_0.verified.txt index 616270eaa..e49261d9a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet6_0.verified.txt @@ -14,7 +14,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string? Value { get; } @@ -43,6 +43,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) @@ -68,6 +69,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet7_0.verified.txt index 616270eaa..e49261d9a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.DotNet7_0.verified.txt @@ -14,7 +14,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string? Value { get; } @@ -43,6 +43,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) @@ -68,6 +69,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Net4_8.verified.txt index 616270eaa..e49261d9a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.Net4_8.verified.txt @@ -14,7 +14,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string? Value { get; } @@ -43,6 +43,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) @@ -68,6 +69,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.verified.txt index 616270eaa..e49261d9a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=NullableString.verified.txt @@ -14,7 +14,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string? Value { get; } @@ -43,6 +43,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) @@ -68,6 +69,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Core3_1.verified.txt index 980e7e7d7..e98677e7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Core3_1.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string Value { get; } @@ -68,6 +68,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet6_0.verified.txt index 980e7e7d7..e98677e7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet6_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string Value { get; } @@ -68,6 +68,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet7_0.verified.txt index 980e7e7d7..e98677e7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.DotNet7_0.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string Value { get; } @@ -68,6 +68,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Net4_8.verified.txt index 980e7e7d7..e98677e7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.Net4_8.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string Value { get; } @@ -68,6 +68,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.verified.txt index 980e7e7d7..e98677e7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesFullIdCorrectly_type=String.verified.txt @@ -13,7 +13,7 @@ [System.Text.Json.Serialization.JsonConverter(typeof(MyTestIdSystemTextJsonConverter))] [System.ComponentModel.TypeConverter(typeof(MyTestIdTypeConverter))] [Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilter(typeof(MyTestIdSchemaFilter))] - readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable + readonly partial struct MyTestId : System.IComparable, System.IEquatable, System.IParsable, System.IConvertible, IStronglyTypedId { public string Value { get; } @@ -68,6 +68,102 @@ } +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + public class EfCoreValueConverter : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter { public EfCoreValueConverter() : this(null) { } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Core3_1.verified.txt index 2e9fbf034..d00e6e636 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Core3_1.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt index 2e9fbf034..d00e6e636 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt index 2e9fbf034..d00e6e636 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Net4_8.verified.txt index 2e9fbf034..d00e6e636 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.Net4_8.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.verified.txt index 2e9fbf034..d00e6e636 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=DapperTypeHandler_i=None.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Core3_1.verified.txt index 508208c37..9609e0712 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Core3_1.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt index 508208c37..9609e0712 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt index 508208c37..9609e0712 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Net4_8.verified.txt index 508208c37..9609e0712 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.Net4_8.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.verified.txt index 508208c37..9609e0712 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=EfCoreValueConverter_i=None.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Core3_1.verified.txt index db59f66c1..c78da82e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Core3_1.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt index db59f66c1..c78da82e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt index db59f66c1..c78da82e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Net4_8.verified.txt index db59f66c1..c78da82e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.Net4_8.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.verified.txt index db59f66c1..c78da82e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=NewtonsoftJson_i=None.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Core3_1.verified.txt index bef90429e..1a12aac12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Core3_1.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet6_0.verified.txt index bef90429e..1a12aac12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet6_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet7_0.verified.txt index bef90429e..1a12aac12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.DotNet7_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Net4_8.verified.txt index bef90429e..1a12aac12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.Net4_8.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.verified.txt index bef90429e..1a12aac12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IComparable.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Core3_1.verified.txt new file mode 100644 index 000000000..380c40d64 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Core3_1.verified.txt @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet6_0.verified.txt new file mode 100644 index 000000000..380c40d64 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet6_0.verified.txt @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet7_0.verified.txt new file mode 100644 index 000000000..380c40d64 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.DotNet7_0.verified.txt @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Net4_8.verified.txt new file mode 100644 index 000000000..380c40d64 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.Net4_8.verified.txt @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.verified.txt new file mode 100644 index 000000000..380c40d64 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IConvertible.verified.txt @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Core3_1.verified.txt index a13e9bec6..88eaec1e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Core3_1.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet6_0.verified.txt index a13e9bec6..88eaec1e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet6_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet7_0.verified.txt index a13e9bec6..88eaec1e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.DotNet7_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Net4_8.verified.txt index a13e9bec6..88eaec1e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.Net4_8.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.verified.txt index a13e9bec6..88eaec1e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IEquatable.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Core3_1.verified.txt index e94e1a2ac..e1c6cb649 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Core3_1.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet6_0.verified.txt index e94e1a2ac..e1c6cb649 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet6_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet7_0.verified.txt index e94e1a2ac..e1c6cb649 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.DotNet7_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Net4_8.verified.txt index e94e1a2ac..e1c6cb649 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.Net4_8.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.verified.txt index e94e1a2ac..e1c6cb649 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IParsable.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Core3_1.verified.txt new file mode 100644 index 000000000..6850318e6 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Core3_1.verified.txt @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt new file mode 100644 index 000000000..6850318e6 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt new file mode 100644 index 000000000..6850318e6 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Net4_8.verified.txt new file mode 100644 index 000000000..6850318e6 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.Net4_8.verified.txt @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.verified.txt new file mode 100644 index 000000000..6850318e6 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=IStronglyTypedId.verified.txt @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public System.Guid Value { get; } + + public MyTestId(System.Guid value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(System.Guid.NewGuid()); + public static readonly MyTestId Empty = new MyTestId(System.Guid.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(System.Guid value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Core3_1.verified.txt index fad5ea0b5..500b02bca 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Core3_1.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet6_0.verified.txt index fad5ea0b5..500b02bca 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet6_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet7_0.verified.txt index fad5ea0b5..500b02bca 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.DotNet7_0.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Net4_8.verified.txt index fad5ea0b5..500b02bca 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.Net4_8.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.verified.txt index fad5ea0b5..500b02bca 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=None_i=None.verified.txt @@ -27,7 +27,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt index f72224715..f8406fb5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt index f72224715..f8406fb5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt index f72224715..f8406fb5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt index f72224715..f8406fb5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.verified.txt index f72224715..f8406fb5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SwaggerSchemaFilter_i=None.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Core3_1.verified.txt index d6d801a99..f1c469105 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Core3_1.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet6_0.verified.txt index d6d801a99..f1c469105 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet6_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet7_0.verified.txt index d6d801a99..f1c469105 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.DotNet7_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Net4_8.verified.txt index d6d801a99..f1c469105 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.Net4_8.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.verified.txt index d6d801a99..f1c469105 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=SystemTextJson_i=None.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Core3_1.verified.txt index 295e92baf..8191145ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Core3_1.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet6_0.verified.txt index 295e92baf..8191145ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet6_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet7_0.verified.txt index 295e92baf..8191145ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.DotNet7_0.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Net4_8.verified.txt index 295e92baf..8191145ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.Net4_8.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.verified.txt index 295e92baf..8191145ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Guid_c=TypeConverter_i=None.verified.txt @@ -28,7 +28,6 @@ if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Core3_1.verified.txt index 4ab87d688..1db4e2f7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt index 4ab87d688..1db4e2f7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt index 4ab87d688..1db4e2f7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Net4_8.verified.txt index 4ab87d688..1db4e2f7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.verified.txt index 4ab87d688..1db4e2f7d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=DapperTypeHandler_i=None.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Core3_1.verified.txt index d3e50467b..4adca1e99 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt index d3e50467b..4adca1e99 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt index d3e50467b..4adca1e99 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Net4_8.verified.txt index d3e50467b..4adca1e99 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.verified.txt index d3e50467b..4adca1e99 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=EfCoreValueConverter_i=None.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Core3_1.verified.txt index b4d9738e7..32c5a1534 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt index b4d9738e7..32c5a1534 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt index b4d9738e7..32c5a1534 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Net4_8.verified.txt index b4d9738e7..32c5a1534 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.verified.txt index b4d9738e7..32c5a1534 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=NewtonsoftJson_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Core3_1.verified.txt index d76d3afd2..e862310d1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet6_0.verified.txt index d76d3afd2..e862310d1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet7_0.verified.txt index d76d3afd2..e862310d1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Net4_8.verified.txt index d76d3afd2..e862310d1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.verified.txt index d76d3afd2..e862310d1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IComparable.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Core3_1.verified.txt new file mode 100644 index 000000000..8ac0f126d --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Core3_1.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet6_0.verified.txt new file mode 100644 index 000000000..8ac0f126d --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet6_0.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet7_0.verified.txt new file mode 100644 index 000000000..8ac0f126d --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.DotNet7_0.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Net4_8.verified.txt new file mode 100644 index 000000000..8ac0f126d --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.Net4_8.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.verified.txt new file mode 100644 index 000000000..8ac0f126d --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IConvertible.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + return Value; + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Core3_1.verified.txt index 5d23b64a1..14ad7e432 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet6_0.verified.txt index 5d23b64a1..14ad7e432 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet7_0.verified.txt index 5d23b64a1..14ad7e432 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Net4_8.verified.txt index 5d23b64a1..14ad7e432 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.verified.txt index 5d23b64a1..14ad7e432 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IEquatable.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Core3_1.verified.txt index 48b56d13e..a68ab7e05 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet6_0.verified.txt index 48b56d13e..a68ab7e05 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet7_0.verified.txt index 48b56d13e..a68ab7e05 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Net4_8.verified.txt index 48b56d13e..a68ab7e05 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.verified.txt index 48b56d13e..a68ab7e05 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IParsable.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Core3_1.verified.txt new file mode 100644 index 000000000..5534fcd9f --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Core3_1.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt new file mode 100644 index 000000000..5534fcd9f --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt new file mode 100644 index 000000000..5534fcd9f --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Net4_8.verified.txt new file mode 100644 index 000000000..5534fcd9f --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.Net4_8.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.verified.txt new file mode 100644 index 000000000..5534fcd9f --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=IStronglyTypedId.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public int Value { get; } + + public MyTestId(int value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(int value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Core3_1.verified.txt index 45272d34a..811d2b214 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet6_0.verified.txt index 45272d34a..811d2b214 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet7_0.verified.txt index 45272d34a..811d2b214 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Net4_8.verified.txt index 45272d34a..811d2b214 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.verified.txt index 45272d34a..811d2b214 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=None_i=None.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt index 297090ba1..20412de25 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt index 297090ba1..20412de25 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt index 297090ba1..20412de25 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt index 297090ba1..20412de25 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.verified.txt index 297090ba1..20412de25 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SwaggerSchemaFilter_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Core3_1.verified.txt index 7c016c3be..4ace828aa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet6_0.verified.txt index 7c016c3be..4ace828aa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet7_0.verified.txt index 7c016c3be..4ace828aa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Net4_8.verified.txt index 7c016c3be..4ace828aa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.verified.txt index 7c016c3be..4ace828aa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=SystemTextJson_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Core3_1.verified.txt index 39f1e9331..838e36729 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet6_0.verified.txt index 39f1e9331..838e36729 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet7_0.verified.txt index 39f1e9331..838e36729 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Net4_8.verified.txt index 39f1e9331..838e36729 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.verified.txt index 39f1e9331..838e36729 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Int_c=TypeConverter_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Core3_1.verified.txt index b513b29b1..41d0affde 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt index b513b29b1..41d0affde 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt index b513b29b1..41d0affde 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Net4_8.verified.txt index b513b29b1..41d0affde 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.verified.txt index b513b29b1..41d0affde 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=DapperTypeHandler_i=None.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Core3_1.verified.txt index cb5754863..1e0e47efd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt index cb5754863..1e0e47efd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt index cb5754863..1e0e47efd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Net4_8.verified.txt index cb5754863..1e0e47efd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.verified.txt index cb5754863..1e0e47efd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=EfCoreValueConverter_i=None.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Core3_1.verified.txt index 7052a3b27..55fa66786 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt index 7052a3b27..55fa66786 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt index 7052a3b27..55fa66786 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Net4_8.verified.txt index 7052a3b27..55fa66786 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.verified.txt index 7052a3b27..55fa66786 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=NewtonsoftJson_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Core3_1.verified.txt index c38fa63f6..ae52bbcf6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet6_0.verified.txt index c38fa63f6..ae52bbcf6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet7_0.verified.txt index c38fa63f6..ae52bbcf6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Net4_8.verified.txt index c38fa63f6..ae52bbcf6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.verified.txt index c38fa63f6..ae52bbcf6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IComparable.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Core3_1.verified.txt new file mode 100644 index 000000000..052a617db --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Core3_1.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet6_0.verified.txt new file mode 100644 index 000000000..052a617db --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet6_0.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet7_0.verified.txt new file mode 100644 index 000000000..052a617db --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.DotNet7_0.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Net4_8.verified.txt new file mode 100644 index 000000000..052a617db --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.Net4_8.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.verified.txt new file mode 100644 index 000000000..052a617db --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IConvertible.verified.txt @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + return Value; + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Core3_1.verified.txt index 13b9b1ac7..4c5a32258 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet6_0.verified.txt index 13b9b1ac7..4c5a32258 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet7_0.verified.txt index 13b9b1ac7..4c5a32258 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Net4_8.verified.txt index 13b9b1ac7..4c5a32258 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.verified.txt index 13b9b1ac7..4c5a32258 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IEquatable.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Core3_1.verified.txt index 45dac2ba8..d08d04159 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet6_0.verified.txt index 45dac2ba8..d08d04159 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet7_0.verified.txt index 45dac2ba8..d08d04159 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Net4_8.verified.txt index 45dac2ba8..d08d04159 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.verified.txt index 45dac2ba8..d08d04159 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IParsable.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Core3_1.verified.txt new file mode 100644 index 000000000..0fa4e8f58 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Core3_1.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt new file mode 100644 index 000000000..0fa4e8f58 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt new file mode 100644 index 000000000..0fa4e8f58 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Net4_8.verified.txt new file mode 100644 index 000000000..0fa4e8f58 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.Net4_8.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.verified.txt new file mode 100644 index 000000000..0fa4e8f58 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=IStronglyTypedId.verified.txt @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public long Value { get; } + + public MyTestId(long value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(0); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(long value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Core3_1.verified.txt index af1658c35..d661d6022 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Core3_1.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet6_0.verified.txt index af1658c35..d661d6022 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet6_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet7_0.verified.txt index af1658c35..d661d6022 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.DotNet7_0.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Net4_8.verified.txt index af1658c35..d661d6022 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.Net4_8.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.verified.txt index af1658c35..d661d6022 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=None_i=None.verified.txt @@ -30,6 +30,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt index 72b024dca..70d47ef71 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt index 72b024dca..70d47ef71 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt index 72b024dca..70d47ef71 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt index 72b024dca..70d47ef71 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.verified.txt index 72b024dca..70d47ef71 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SwaggerSchemaFilter_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Core3_1.verified.txt index 17a45333f..3617e5c9f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet6_0.verified.txt index 17a45333f..3617e5c9f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet7_0.verified.txt index 17a45333f..3617e5c9f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Net4_8.verified.txt index 17a45333f..3617e5c9f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.verified.txt index 17a45333f..3617e5c9f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=SystemTextJson_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Core3_1.verified.txt index e22d0478c..052d31953 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet6_0.verified.txt index e22d0478c..052d31953 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet7_0.verified.txt index e22d0478c..052d31953 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Net4_8.verified.txt index e22d0478c..052d31953 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.verified.txt index e22d0478c..052d31953 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=Long_c=TypeConverter_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Core3_1.verified.txt index 93afbf6de..8a3079836 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt index 93afbf6de..8a3079836 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt index 93afbf6de..8a3079836 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Net4_8.verified.txt index 93afbf6de..8a3079836 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.verified.txt index 93afbf6de..8a3079836 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=DapperTypeHandler_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Core3_1.verified.txt index 9114f2d54..15044ef45 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt index 9114f2d54..15044ef45 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt index 9114f2d54..15044ef45 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Net4_8.verified.txt index 9114f2d54..15044ef45 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.verified.txt index 9114f2d54..15044ef45 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=EfCoreValueConverter_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Core3_1.verified.txt index 181d85e44..c5ea04e4d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Core3_1.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt index 181d85e44..c5ea04e4d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt index 181d85e44..c5ea04e4d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Net4_8.verified.txt index 181d85e44..c5ea04e4d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.Net4_8.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.verified.txt index 181d85e44..c5ea04e4d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=NewtonsoftJson_i=None.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Core3_1.verified.txt index 3a19fc65e..dded633b8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet6_0.verified.txt index 3a19fc65e..dded633b8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet7_0.verified.txt index 3a19fc65e..dded633b8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Net4_8.verified.txt index 3a19fc65e..dded633b8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.verified.txt index 3a19fc65e..dded633b8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IComparable.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Core3_1.verified.txt new file mode 100644 index 000000000..dc7a58cb1 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Core3_1.verified.txt @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet6_0.verified.txt new file mode 100644 index 000000000..dc7a58cb1 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet6_0.verified.txt @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet7_0.verified.txt new file mode 100644 index 000000000..dc7a58cb1 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.DotNet7_0.verified.txt @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Net4_8.verified.txt new file mode 100644 index 000000000..dc7a58cb1 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.Net4_8.verified.txt @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.verified.txt new file mode 100644 index 000000000..dc7a58cb1 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IConvertible.verified.txt @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Core3_1.verified.txt index b4c2d5867..aa257c086 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet6_0.verified.txt index b4c2d5867..aa257c086 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet7_0.verified.txt index b4c2d5867..aa257c086 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Net4_8.verified.txt index b4c2d5867..aa257c086 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.verified.txt index b4c2d5867..aa257c086 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IEquatable.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Core3_1.verified.txt index f71234e03..69f6bd20d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet6_0.verified.txt index f71234e03..69f6bd20d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet7_0.verified.txt index f71234e03..69f6bd20d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Net4_8.verified.txt index f71234e03..69f6bd20d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.verified.txt index f71234e03..69f6bd20d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IParsable.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Core3_1.verified.txt new file mode 100644 index 000000000..894b2d694 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Core3_1.verified.txt @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt new file mode 100644 index 000000000..894b2d694 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt new file mode 100644 index 000000000..894b2d694 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Net4_8.verified.txt new file mode 100644 index 000000000..894b2d694 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.Net4_8.verified.txt @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.verified.txt new file mode 100644 index 000000000..894b2d694 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=IStronglyTypedId.verified.txt @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public MassTransit.NewId Value { get; } + + public MyTestId(MassTransit.NewId value) + { + Value = value; + } + + public static MyTestId New() => new MyTestId(MassTransit.NewId.Next()); + public static readonly MyTestId Empty = new MyTestId(MassTransit.NewId.Empty); + + public bool Equals(MyTestId other) => this.Value.Equals(other.Value); + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value.ToString(); + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(MassTransit.NewId value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Core3_1.verified.txt index 7e4892f41..45aeb6284 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Core3_1.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet6_0.verified.txt index 7e4892f41..45aeb6284 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet6_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet7_0.verified.txt index 7e4892f41..45aeb6284 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.DotNet7_0.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Net4_8.verified.txt index 7e4892f41..45aeb6284 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.Net4_8.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.verified.txt index 7e4892f41..45aeb6284 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=None_i=None.verified.txt @@ -31,6 +31,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt index 699828755..4859be292 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt index 699828755..4859be292 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt index 699828755..4859be292 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt index 699828755..4859be292 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.verified.txt index 699828755..4859be292 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SwaggerSchemaFilter_i=None.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Core3_1.verified.txt index 3de0600ab..9f8fd74ba 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Core3_1.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet6_0.verified.txt index 3de0600ab..9f8fd74ba 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet6_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet7_0.verified.txt index 3de0600ab..9f8fd74ba 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.DotNet7_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Net4_8.verified.txt index 3de0600ab..9f8fd74ba 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.Net4_8.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.verified.txt index 3de0600ab..9f8fd74ba 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=SystemTextJson_i=None.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Core3_1.verified.txt index 757eb4ebb..7450bdc12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Core3_1.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet6_0.verified.txt index 757eb4ebb..7450bdc12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet6_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet7_0.verified.txt index 757eb4ebb..7450bdc12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.DotNet7_0.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Net4_8.verified.txt index 757eb4ebb..7450bdc12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.Net4_8.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.verified.txt index 757eb4ebb..7450bdc12 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=MassTransitNewId_c=TypeConverter_i=None.verified.txt @@ -32,6 +32,7 @@ public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Core3_1.verified.txt index 50259e988..466f1d0d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Core3_1.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt index 50259e988..466f1d0d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet6_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt index 50259e988..466f1d0d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.DotNet7_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Net4_8.verified.txt index 50259e988..466f1d0d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.Net4_8.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.verified.txt index 50259e988..466f1d0d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=DapperTypeHandler_i=None.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Core3_1.verified.txt index e1a174104..8e3120645 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Core3_1.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt index e1a174104..8e3120645 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet6_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt index e1a174104..8e3120645 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.DotNet7_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Net4_8.verified.txt index e1a174104..8e3120645 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.Net4_8.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.verified.txt index e1a174104..8e3120645 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=EfCoreValueConverter_i=None.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Core3_1.verified.txt index 9660c1fc0..07b19dc5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Core3_1.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt index 9660c1fc0..07b19dc5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet6_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt index 9660c1fc0..07b19dc5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.DotNet7_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Net4_8.verified.txt index 9660c1fc0..07b19dc5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.Net4_8.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.verified.txt index 9660c1fc0..07b19dc5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=NewtonsoftJson_i=None.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Core3_1.verified.txt index d779d1af4..8429ca5ed 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Core3_1.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet6_0.verified.txt index d779d1af4..8429ca5ed 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet6_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet7_0.verified.txt index d779d1af4..8429ca5ed 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.DotNet7_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Net4_8.verified.txt index d779d1af4..8429ca5ed 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.Net4_8.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.verified.txt index d779d1af4..8429ca5ed 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IComparable.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); public int CompareTo(MyTestId other) diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Core3_1.verified.txt new file mode 100644 index 000000000..4f1dd8c87 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Core3_1.verified.txt @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : System.IConvertible + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet6_0.verified.txt new file mode 100644 index 000000000..4f1dd8c87 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet6_0.verified.txt @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : System.IConvertible + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet7_0.verified.txt new file mode 100644 index 000000000..4f1dd8c87 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.DotNet7_0.verified.txt @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : System.IConvertible + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Net4_8.verified.txt new file mode 100644 index 000000000..4f1dd8c87 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.Net4_8.verified.txt @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : System.IConvertible + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.verified.txt new file mode 100644 index 000000000..4f1dd8c87 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IConvertible.verified.txt @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : System.IConvertible + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Core3_1.verified.txt index bb2e2c7d2..f9a873fac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Core3_1.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet6_0.verified.txt index bb2e2c7d2..f9a873fac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet6_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet7_0.verified.txt index bb2e2c7d2..f9a873fac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.DotNet7_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Net4_8.verified.txt index bb2e2c7d2..f9a873fac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.Net4_8.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.verified.txt index bb2e2c7d2..f9a873fac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IEquatable.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Core3_1.verified.txt index cb8f66e2d..cabf52c73 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Core3_1.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet6_0.verified.txt index cb8f66e2d..cabf52c73 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet6_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet7_0.verified.txt index cb8f66e2d..cabf52c73 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.DotNet7_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Net4_8.verified.txt index cb8f66e2d..cabf52c73 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.Net4_8.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.verified.txt index cb8f66e2d..cabf52c73 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IParsable.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Core3_1.verified.txt new file mode 100644 index 000000000..00599cf8c --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Core3_1.verified.txt @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : IStronglyTypedId + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt new file mode 100644 index 000000000..00599cf8c --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : IStronglyTypedId + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt new file mode 100644 index 000000000..00599cf8c --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : IStronglyTypedId + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Net4_8.verified.txt new file mode 100644 index 000000000..00599cf8c --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.Net4_8.verified.txt @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : IStronglyTypedId + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.verified.txt new file mode 100644 index 000000000..00599cf8c --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=IStronglyTypedId.verified.txt @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + +#nullable enable + readonly partial struct MyTestId : IStronglyTypedId + { + public string? Value { get; } + + public MyTestId(string? value) + { + Value = value; + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object? obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + public override string? ToString() => Value; + + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string? value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Core3_1.verified.txt index fe1e43665..18d1e425b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Core3_1.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet6_0.verified.txt index fe1e43665..18d1e425b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet6_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet7_0.verified.txt index fe1e43665..18d1e425b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.DotNet7_0.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Net4_8.verified.txt index fe1e43665..18d1e425b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.Net4_8.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.verified.txt index fe1e43665..18d1e425b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=None_i=None.verified.txt @@ -39,6 +39,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt index c85338e9a..e1af0c06c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Core3_1.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt index c85338e9a..e1af0c06c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet6_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt index c85338e9a..e1af0c06c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.DotNet7_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt index c85338e9a..e1af0c06c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.Net4_8.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.verified.txt index c85338e9a..e1af0c06c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SwaggerSchemaFilter_i=None.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Core3_1.verified.txt index c049fb7f5..a8063f045 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Core3_1.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet6_0.verified.txt index c049fb7f5..a8063f045 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet6_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet7_0.verified.txt index c049fb7f5..a8063f045 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.DotNet7_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Net4_8.verified.txt index c049fb7f5..a8063f045 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.Net4_8.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.verified.txt index c049fb7f5..a8063f045 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=SystemTextJson_i=None.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Core3_1.verified.txt index 50b3c0585..4de84ad41 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Core3_1.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet6_0.verified.txt index 50b3c0585..4de84ad41 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet6_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet7_0.verified.txt index 50b3c0585..4de84ad41 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.DotNet7_0.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Net4_8.verified.txt index 50b3c0585..4de84ad41 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.Net4_8.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.verified.txt index 50b3c0585..4de84ad41 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=NullableString_c=TypeConverter_i=None.verified.txt @@ -40,6 +40,7 @@ public override int GetHashCode() => Value?.GetHashCode() ?? 0; public override string? ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Core3_1.verified.txt new file mode 100644 index 000000000..253750032 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Core3_1.verified.txt @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet6_0.verified.txt new file mode 100644 index 000000000..253750032 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet6_0.verified.txt @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet7_0.verified.txt new file mode 100644 index 000000000..253750032 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.DotNet7_0.verified.txt @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Net4_8.verified.txt new file mode 100644 index 000000000..253750032 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.Net4_8.verified.txt @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.verified.txt new file mode 100644 index 000000000..253750032 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IConvertible.verified.txt @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : System.IConvertible + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + +//ICONVERTIBLE +#nullable enable + + public System.TypeCode GetTypeCode() + { + throw new System.NotImplementedException(); + } + + public bool ToBoolean(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public byte ToByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public char ToChar(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public System.DateTime ToDateTime(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public decimal ToDecimal(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public double ToDouble(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public short ToInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public int ToInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public long ToInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public sbyte ToSByte(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public float ToSingle(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public string ToString(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public object ToType(System.Type conversionType, System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ushort ToUInt16(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public uint ToUInt32(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } + + public ulong ToUInt64(System.IFormatProvider? provider) + { + throw new System.NotImplementedException(); + } +#nullable disable + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Core3_1.verified.txt new file mode 100644 index 000000000..a4948b084 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Core3_1.verified.txt @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt new file mode 100644 index 000000000..a4948b084 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet6_0.verified.txt @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt new file mode 100644 index 000000000..a4948b084 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.DotNet7_0.verified.txt @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Net4_8.verified.txt new file mode 100644 index 000000000..a4948b084 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.Net4_8.verified.txt @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.verified.txt new file mode 100644 index 000000000..a4948b084 --- /dev/null +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_type=String_c=None_i=IStronglyTypedId.verified.txt @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by the StronglyTypedId source generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // publicly visible type or member must be documented + + readonly partial struct MyTestId : IStronglyTypedId + { + public string Value { get; } + + public MyTestId(string value) + { + Value = value ?? throw new System.ArgumentNullException(nameof(value)); + } + + public static readonly MyTestId Empty = new MyTestId(string.Empty); + + public bool Equals(MyTestId other) + { + return (Value, other.Value) switch + { + (null, null) => true, + (null, _) => false, + (_, null) => false, + (_, _) => Value.Equals(other.Value), + }; + } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + return obj is MyTestId other && Equals(other); + } + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => Value; + public static bool operator ==(MyTestId a, MyTestId b) => a.Equals(b); + public static bool operator !=(MyTestId a, MyTestId b) => !(a == b); + + public static IStronglyTypedId Create(string value) + { + return new MyTestId(value); + } + + } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Core3_1.verified.txt index ff61cdde7..aa83dffa7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Core3_1.verified.txt @@ -32,7 +32,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet6_0.verified.txt index ff61cdde7..aa83dffa7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet6_0.verified.txt @@ -32,7 +32,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet7_0.verified.txt index ff61cdde7..aa83dffa7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.DotNet7_0.verified.txt @@ -32,7 +32,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Net4_8.verified.txt index ff61cdde7..aa83dffa7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.Net4_8.verified.txt @@ -32,7 +32,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.verified.txt index ff61cdde7..aa83dffa7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=0.verified.txt @@ -32,7 +32,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Core3_1.verified.txt index dacf3158c..02e2c1cb0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Core3_1.verified.txt @@ -34,7 +34,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet6_0.verified.txt index dacf3158c..02e2c1cb0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet6_0.verified.txt @@ -34,7 +34,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet7_0.verified.txt index dacf3158c..02e2c1cb0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.DotNet7_0.verified.txt @@ -34,7 +34,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Net4_8.verified.txt index dacf3158c..02e2c1cb0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.Net4_8.verified.txt @@ -34,7 +34,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.verified.txt index dacf3158c..02e2c1cb0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=1.verified.txt @@ -34,7 +34,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Core3_1.verified.txt index b71458e7e..a3139783d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Core3_1.verified.txt @@ -36,7 +36,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet6_0.verified.txt index b71458e7e..a3139783d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet6_0.verified.txt @@ -36,7 +36,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet7_0.verified.txt index b71458e7e..a3139783d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.DotNet7_0.verified.txt @@ -36,7 +36,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Net4_8.verified.txt index b71458e7e..a3139783d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.Net4_8.verified.txt @@ -36,7 +36,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.verified.txt index b71458e7e..a3139783d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdWithNestedClassCorrectly_nestedClassCount=2.verified.txt @@ -36,7 +36,6 @@ namespace MyTestNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyTestId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Core3_1.verified.txt index 56be7f36f..af6ecfbbe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -260,7 +272,6 @@ namespace StronglyTypedIds if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet6_0.verified.txt index 56be7f36f..af6ecfbbe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -260,7 +272,6 @@ namespace StronglyTypedIds if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet7_0.verified.txt index 56be7f36f..af6ecfbbe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -260,7 +272,6 @@ namespace StronglyTypedIds if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Net4_8.verified.txt index 56be7f36f..af6ecfbbe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -260,7 +272,6 @@ namespace StronglyTypedIds if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.verified.txt index 56be7f36f..af6ecfbbe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateDefaultIdInGlobalNamespace.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -260,7 +272,6 @@ namespace StronglyTypedIds if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Core3_1.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet6_0.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet7_0.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Net4_8.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInFileScopedNamespace.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Core3_1.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet6_0.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet7_0.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Net4_8.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.verified.txt index 1d8786678..29becb56d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdInNamespace.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=SystemTextJson.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=TypeConverter.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Core3_1.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Net4_8.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithNamedParameters_backingType=Guid_converter=null.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt index 0e88633ad..5ded30500 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson, SystemTextJson.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt index 8a5c7e797..a19563662 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=NewtonsoftJson.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.verified.txt index 24997c508..594412cd4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=SystemTextJson.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.verified.txt index 839a3cdf0..bb7bc08f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=TypeConverter.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,7 +273,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Core3_1.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Net4_8.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.verified.txt index c5dd24327..793521ca2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateIdWithPositionalParameters_backingType=Guid_converter=null.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyTests.TestNameSpace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Core3_1.verified.txt index 1d386be5d..b403ce775 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyContracts.V1 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -366,7 +377,6 @@ namespace MyContracts.V2 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet6_0.verified.txt index 1d386be5d..b403ce775 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyContracts.V1 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -366,7 +377,6 @@ namespace MyContracts.V2 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet7_0.verified.txt index 1d386be5d..b403ce775 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyContracts.V1 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -366,7 +377,6 @@ namespace MyContracts.V2 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Net4_8.verified.txt index 1d386be5d..b403ce775 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyContracts.V1 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -366,7 +377,6 @@ namespace MyContracts.V2 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.verified.txt index 1d386be5d..b403ce775 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateMultipleIdsWithSameName.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -262,7 +274,6 @@ namespace MyContracts.V1 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); @@ -366,7 +377,6 @@ namespace MyContracts.V2 if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Core3_1.verified.txt index 91d1a1543..ab210aa8a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -264,7 +276,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet6_0.verified.txt index 91d1a1543..ab210aa8a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -264,7 +276,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet7_0.verified.txt index 91d1a1543..ab210aa8a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -264,7 +276,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Net4_8.verified.txt index 91d1a1543..ab210aa8a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -264,7 +276,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.verified.txt index 91d1a1543..ab210aa8a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateNestedIdInFileScopeNamespace.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -264,7 +276,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Core3_1.verified.txt index 82c6f9f8d..9a300aafe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -268,7 +280,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet6_0.verified.txt index 82c6f9f8d..9a300aafe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -268,7 +280,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet7_0.verified.txt index 82c6f9f8d..9a300aafe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -268,7 +280,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Net4_8.verified.txt index 82c6f9f8d..9a300aafe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -268,7 +280,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.verified.txt index 82c6f9f8d..9a300aafe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanGenerateVeryNestedIdInFileScopeNamespace.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -268,7 +280,6 @@ namespace SomeNamespace if (ReferenceEquals(null, obj)) return false; return obj is MyId other && Equals(other); } - public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Core3_1.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Core3_1.verified.txt index e53221f19..7c0a4e4a5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Core3_1.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Core3_1.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,6 +273,7 @@ namespace StronglyTypedIds public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyId a, MyId b) => a.Equals(b); public static bool operator !=(MyId a, MyId b) => !(a == b); public int CompareTo(MyId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet6_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet6_0.verified.txt index e53221f19..7c0a4e4a5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet6_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet6_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,6 +273,7 @@ namespace StronglyTypedIds public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyId a, MyId b) => a.Equals(b); public static bool operator !=(MyId a, MyId b) => !(a == b); public int CompareTo(MyId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet7_0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet7_0.verified.txt index e53221f19..7c0a4e4a5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet7_0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.DotNet7_0.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,6 +273,7 @@ namespace StronglyTypedIds public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyId a, MyId b) => a.Equals(b); public static bool operator !=(MyId a, MyId b) => !(a == b); public int CompareTo(MyId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Net4_8.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Net4_8.verified.txt index e53221f19..7c0a4e4a5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Net4_8.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.Net4_8.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,6 +273,7 @@ namespace StronglyTypedIds public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyId a, MyId b) => a.Equals(b); public static bool operator !=(MyId a, MyId b) => !(a == b); public int CompareTo(MyId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.verified.txt index e53221f19..7c0a4e4a5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/StronglyTypedIdGeneratorTests.CanOverrideDefaultsUsingGlobalAttribute.verified.txt @@ -222,9 +222,21 @@ namespace StronglyTypedIds // ReSharper disable once InconsistentNaming /// - /// Implement the interface + /// Implement the interface /// - IParsable = 8 + IParsable = 8, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IConvertible = 16, + + // ReSharper disable once InconsistentNaming + /// + /// Implement the interface + /// + IStronglyTypedId = 32 } } @@ -261,6 +273,7 @@ namespace StronglyTypedIds public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value.ToString(); + public static bool operator ==(MyId a, MyId b) => a.Equals(b); public static bool operator !=(MyId a, MyId b) => !(a == b); public int CompareTo(MyId other) => Value.CompareTo(other.Value); diff --git a/test/StronglyTypedIds.Tests/StronglyTypedId.cs b/test/StronglyTypedIds.Tests/StronglyTypedId.cs new file mode 100644 index 000000000..d59f89274 --- /dev/null +++ b/test/StronglyTypedIds.Tests/StronglyTypedId.cs @@ -0,0 +1,2 @@ +public interface IStronglyTypedId { +} diff --git a/version.props b/version.props index f3b74899d..7c3318131 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ - 1.0.23 + 1.0.79 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)