Exemple #1
0
        public void LazinatorReadOnlySpanInStruct()
        {
            // we have special code to deal with ReadOnlySpans within structs. So, here is a test to make sure that it works.
            WReadOnlySpanChar wReadOnlySpanChar = new WReadOnlySpanChar();

            wReadOnlySpanChar.Value = new Span <char>("mystring".ToArray());
            var result = CloneWithOptionalVerification(wReadOnlySpanChar, false, false);

            new string(result.Value).Should().Be("mystring");
        }
Exemple #2
0
        public void CloneWithoutBuffer_WReadOnlySpanChar()
        {
            WReadOnlySpanChar GetWReadOnlySpanChar()
            {
                WReadOnlySpanChar wReadOnlySpanChar = new WReadOnlySpanChar();

                wReadOnlySpanChar.Value = new Span <char>("mystring".ToArray());
                return(wReadOnlySpanChar);
            }

            VerifyCloningEquivalence(() => GetWReadOnlySpanChar());
        }