コード例 #1
0
        public void ProteinBenchmarkIdentifier_AreEqualWhenProjectIDAndProcessorAndThreadsAreEqual()
        {
            // Arrange
            var x = new ProteinBenchmarkIdentifier(1234, "i9", 8);
            var y = new ProteinBenchmarkIdentifier(1234, "i9", 8);
            // Act
            var result = x.Equals(y) & x.GetHashCode() == y.GetHashCode();

            // Assert
            Assert.IsTrue(result);
        }
コード例 #2
0
        public void ProteinBenchmarkIdentifier_AreNotEqualWhenProjectIDAreNotEqual()
        {
            // Arrange
            var x = new ProteinBenchmarkIdentifier(1234, ProteinBenchmarkIdentifier.NoProcessor, ProteinBenchmarkIdentifier.NoThreads);
            var y = new ProteinBenchmarkIdentifier(5678, ProteinBenchmarkIdentifier.NoProcessor, ProteinBenchmarkIdentifier.NoThreads);
            // Act
            var result = x.Equals(y) | x.GetHashCode() == y.GetHashCode();

            // Assert
            Assert.IsFalse(result);
        }