コード例 #1
0
        public void StudyInstanceUID_Setter_AfterGettingHashCode_ThrowsException()
        {
            // Arrange
            var study = new StudyInfo
            {
                StudyInstanceUID = new InfoIdentifier("123")
            };

            // Act
            study.GetHashCode();

            // Assert
            Assert.That(() => study.StudyInstanceUID = new InfoIdentifier("321"), Throws.InvalidOperationException);
        }
コード例 #2
0
        public void GetHashCode_PatientsWithDifferencNameAndIDAreNotEqual()
        {
            // Arrange
            var study1 = new StudyInfo
            {
                StudyInstanceUID = new InfoIdentifier("123")
            };
            var study2 = new StudyInfo
            {
                StudyInstanceUID = new InfoIdentifier("321")
            };

            // Act
            var hash1 = study1.GetHashCode();
            var hash2 = study2.GetHashCode();

            // Assert
            Assert.That(hash1, Is.Not.EqualTo(hash2));
        }
コード例 #3
0
        public void GetHashCode_PatientsWithSameIDAndNameAreEqual()
        {
            // Arrange
            var infoIdentifier = new InfoIdentifier("123");
            var study1 = new StudyInfo
            {
                StudyInstanceUID = infoIdentifier
            };
            var study2 = new StudyInfo
            {
                StudyInstanceUID = infoIdentifier
            };

            // Act
            var hash1 = study1.GetHashCode();
            var hash2 = study2.GetHashCode();

            // Assert
            Assert.That(hash1, Is.EqualTo(hash2));
        }