public void TestGetHashCode() { var rand = new Random(); var a = new DiceRoll( d4: (uint)rand.Next(), d6: (uint)rand.Next(), d8: (uint)rand.Next(), d10: (uint)rand.Next(), d12: (uint)rand.Next(), modifier: rand.Next()); var b = new DiceRoll( d4: a.D4, d6: a.D6, d8: a.D8, d10: a.D10, d12: a.D12, modifier: a.Modifier); var c = new DiceRoll( d4: (uint)rand.Next(), d6: (uint)rand.Next(), d8: (uint)rand.Next(), d10: (uint)rand.Next(), d12: (uint)rand.Next(), modifier: rand.Next()); Assert.That(a.GetHashCode(), Is.EqualTo(a.GetHashCode())); Assert.That(a.GetHashCode(), Is.EqualTo(b.GetHashCode())); Assert.That(a.GetHashCode(), Is.Not.EqualTo(c.GetHashCode())); }