Esempio n. 1
0
        public ArrayRun GrowBitArraySegment(int bitSegmentIndex, int additionalBytes)
        {
            // all the data has been moved already
            // just return a new ArrayRun with the desired change.
            var content    = ElementContent.ToList();
            var oldSegment = (ArrayRunBitArraySegment)content[bitSegmentIndex];

            content[bitSegmentIndex] = new ArrayRunBitArraySegment(oldSegment.Name, oldSegment.Length + additionalBytes, oldSegment.SourceArrayName);
            return(new ArrayRun(owner, FormatString, LengthFromAnchor, Start, ElementCount, content, PointerSources, PointerSourcesForInnerElements));
        }
Esempio n. 2
0
        public void ElementWithSpace_CopyBitFlags_ResultHasQuotes()
        {
            Model.SetList("list", new[] { "noSpaces", "with spaces" });
            Model[0] = 2;
            var segment = new ArrayRunBitArraySegment("name", 1, "list");

            var text = segment.ToText(Model, 0, false);

            Assert.Equal("- \"with spaces\" /", text);
        }