示例#1
0
        public void Its_enumerator_Current_returns_the_same_item_until_MoveNext_gets_called()
        {
            var enumerator = _httpHeaders.GetEnumerator();

            enumerator.MoveNext();

            var current = enumerator.Current;

            current.Should().Be(enumerator.Current);

            enumerator.MoveNext();

            current.Should().NotBe(enumerator.Current);
        }
示例#2
0
        //[Fact(Skip = "System.TypeLoadException : The generic type 'System.Collections.Generic.KeyValuePair`2' was used with an invalid instantiation in assembly 'System.Private.CoreLib")]
        public void Its_enumerator_Current_returns_the_same_item_until_MoveNext_gets_called()
        {
            var httpHeader = new HttpHeadersSingleSegment(new Span <byte>(new UTF8Encoding().GetBytes(HeadersString)));
            var enumerator = httpHeader.GetEnumerator();

            enumerator.MoveNext();

            var current = enumerator.Current;

            current.Should().Be(enumerator.Current);

            enumerator.MoveNext();

            current.Should().NotBe(enumerator.Current);
        }
示例#3
0
        //[Fact(Skip = "System.TypeLoadException : The generic type 'System.Collections.Generic.KeyValuePair`2' was used with an invalid instantiation in assembly 'System.Private.CoreLib")]
        public void Its_enumerator_Current_returns_the_same_item_until_MoveNext_gets_called()
        {
            var httpHeader = new HttpHeadersSingleSegment(new Span <byte>(new UTF8Encoding().GetBytes(HeadersString)));
            var enumerator = httpHeader.GetEnumerator();

            enumerator.MoveNext();

            var current = enumerator.Current;

            Assert.True(current.Key == enumerator.Current.Key);
            Assert.True(current.Value == enumerator.Current.Value);

            enumerator.MoveNext();

            current = enumerator.Current;
            Assert.True(current.Key == enumerator.Current.Key);
            Assert.True(current.Value == enumerator.Current.Value);
        }