public static void TwoParameters(string value1, int value2)
    {
        var hashCode1 = MultiplyAddHash.CreateHashCode(value1, value2);
        var hashCode2 = MultiplyAddHashBuilder.Create()
                        .CombineIntoHash(value1)
                        .CombineIntoHash(value2)
                        .BuildHash();

        hashCode1.Should().Be(hashCode2);
    }
    public static void FourParameters(string value1, int value2, char value3, double value4)
    {
        var hashCode1 = MultiplyAddHash.CreateHashCode(value1, value2, value3, value4);
        var hashCode2 = MultiplyAddHashBuilder.Create()
                        .CombineIntoHash(value1)
                        .CombineIntoHash(value2)
                        .CombineIntoHash(value3)
                        .CombineIntoHash(value4)
                        .BuildHash();

        hashCode1.Should().Be(hashCode2);
    }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the hash code of this pending migration.
 /// </summary>
 public override int GetHashCode() => MultiplyAddHash.CreateHashCode(MigrationVersion, MigrationType);
 public int MultiplyAdd4Parameters() => MultiplyAddHash.CreateHashCode(First, Second, Third, Fourth);
 public int MultiplyAdd2Parameters() => MultiplyAddHash.CreateHashCode(First, Second);
 public int MultiplyAdd4Parameters() => MultiplyAddHash.CreateHashCode(Foo, Bar, Baz, Qux);
 public int MultiplyAdd2Parameters() => MultiplyAddHash.CreateHashCode(Foo, Bar);