Exemplo n.º 1
0
        ///<inheritdoc/>
        public override int GetHashCode()
        {
            int hash = 17;

            // Overflow is fine, just wrap
            unchecked
            {
                hash = (hash * 29) + Breach.GetHashCode();
                hash = (hash * 29) + MineCount.GetHashCode();
            }

            return(hash);
        }
Exemplo n.º 2
0
    public void GetHashCode_ReturnsSameHashCodesForSameValues()
    {
        var p = new Breach()
        {
            Name = "VALUE",
        };

        var other = new Breach()
        {
            Name = "VALUE",
        };

        Assert.Equal(p.GetHashCode(), other.GetHashCode());
    }
Exemplo n.º 3
0
    public void GetHashCode_ReturnsDifferentHashCodesForDifferentValues()
    {
        var p = new Breach()
        {
            Name = "FIRST",
        };

        var other = new Breach()
        {
            Name = "SECOND",
        };

        Assert.NotEqual(p.GetHashCode(), other.GetHashCode());
    }