Example #1
0
        public void IsCompatibleKey_should_be_callable_indirectly()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                PULDictionary <int, string> .IsCompatibleKeyObject().Body = key => key is string;

                // Act
                var actual = ULDictionary <int, string> .IsCompatibleKey("aiueo");

                // Assert
                Assert.IsTrue(actual);
            }
        }
Example #2
0
 public void EnumeratorCurrent_should_be_callable_indirectly()
 {
     using (new IndirectionsContext())
     {
         // Arrange
         PULDictionaryOfTKeyOfTValueEnumerator<int, string>.CurrentGet().Body = 
             (ref ULDictionary<int, string>.Enumerator @this) => new KeyValuePair<int, string>(42, "にゃんぱすー");
         
         // Act
         var enumerator = new ULDictionary<int, string>.Enumerator();
         var actual = enumerator.Current;
         
         // Assert
         Assert.AreEqual(42, actual.Key);
         Assert.AreEqual("にゃんぱすー", actual.Value);
     }
 }
Example #3
0
        public void IEnumeratorCurrent_should_be_callable_indirectly()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                PULDictionaryOfTKeyOfTValueEnumerator <int, string> .SystemCollectionsIEnumeratorCurrentGet().Body =
                    (ref ULDictionary <int, string> .Enumerator @this) => new KeyValuePair <int, string>(42, "今回はここまで");

                // Act
                var enumerator = new ULDictionary <int, string> .Enumerator();

                var actual = (KeyValuePair <int, string>)((IEnumerator)enumerator).Current;

                // Assert
                Assert.AreEqual(42, actual.Key);
                Assert.AreEqual("今回はここまで", actual.Value);
            }
        }