Exemple #1
0
        public void GetSequencedHashCode_RandomSequence_GeneratedHashCode()
        {
            // Arrange
            var sequence = GetStringSequence(Random);
            var expected = SequencedEqualityComparer.GetSequencedHashCode(sequence);

            // Act
            var sequencedHashCode = sequence.GetSequencedHashCode();

            // Assert
            Assert.That(sequencedHashCode, Is.EqualTo(expected));
        }
Exemple #2
0
        public void GetSequencedHashCode_RandomSequenceWithNull_GeneratedHashCode()
        {
            Run.If(AllowsDuplicates);
            // Arrange
            var items    = GetStrings(Random).WithNull(Random);
            var sequence = GetSequence(items, allowsNull: true);
            var expected = SequencedEqualityComparer.GetSequencedHashCode(sequence);

            // Act
            var sequencedHashCode = sequence.GetSequencedHashCode();

            // Assert
            Assert.That(sequencedHashCode, Is.EqualTo(expected));
        }