コード例 #1
0
        public void ProteinCollection_TryGetValue_ReturnsFalseWhenTheCollectionIsEmpty()
        {
            // Arrange
            var collection = new ProteinCollection();
            // Act
            bool result = collection.TryGetValue(1, out var protein);

            // Assert
            Assert.IsFalse(result);
            Assert.IsNull(protein);
        }
コード例 #2
0
        public void ProteinCollection_TryGetValue_ReturnsTrueWhenTheKeyExists()
        {
            // Arrange
            var collection = new ProteinCollection
            {
                CreateValidProtein(1)
            };
            // Act
            bool result = collection.TryGetValue(1, out var protein);

            // Assert
            Assert.IsTrue(result);
            Assert.IsNotNull(protein);
        }