コード例 #1
0
        public void GetKeyType_returns_null_for_non_dictionary_type(GenericDictionaryFactory sut)
        {
            // Act
            var result = sut.GetKeyType(typeof(ISampleService));

            // Assert
            Assert.That(result, Is.Null);
        }
コード例 #2
0
        public void GetKeyType_returns_correct_key_type_for_generic_dictionary(GenericDictionaryFactory sut)
        {
            // Act
            var result = sut.GetKeyType(typeof(IDictionary <int, ISampleService>));

            // Assert
            Assert.That(result, Is.EqualTo(typeof(int)));
        }