mirror of
https://github.com/microsoft/HybridRow.git
synced 2026-01-23 19:33:16 +00:00
Copied dotnet code from CosmosDB repository
This commit is contained in:
42
dotnet/src/HybridRow.Tests.Unit/CustomerSchema/PostalCode.cs
Normal file
42
dotnet/src/HybridRow.Tests.Unit/CustomerSchema/PostalCode.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
// ------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#pragma warning disable SA1401 // Fields should be private
|
||||
|
||||
namespace Microsoft.Azure.Cosmos.Serialization.HybridRow.Tests.Unit.CustomerSchema
|
||||
{
|
||||
internal sealed class PostalCode
|
||||
{
|
||||
public int Zip;
|
||||
public short? Plus4;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (object.ReferenceEquals(null, obj))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (object.ReferenceEquals(this, obj))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return obj is PostalCode && this.Equals((PostalCode)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
return (this.Zip * 397) ^ this.Plus4.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
private bool Equals(PostalCode other)
|
||||
{
|
||||
return this.Zip == other.Zip && this.Plus4 == other.Plus4;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user