コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldComputePageCatalogueOverThreePages()
        public virtual void ShouldComputePageCatalogueOverThreePages()
        {
            // given
            StubCollector collector = new StubCollector(4);

            collector.Visit(_key, _value);
            collector.Visit(_key, _value);

            // when
            _key.putInt(0, 24);
            collector.Visit(_key, _value);
            _key.putInt(0, 62);
            collector.Visit(_key, _value);

            _key.putInt(0, 78);
            collector.Visit(_key, _value);
            _key.putInt(0, 84);
            collector.Visit(_key, _value);
            _key.putInt(0, 96);
            collector.Visit(_key, _value);
            _key.putInt(0, 128);
            collector.Visit(_key, _value);

            _key.putInt(0, 133);
            collector.Visit(_key, _value);

            // then
            assertArrayEquals(new sbyte[] { 0, 0, 0, 24, 0, 0, 0, 62, 0, 0, 0, 78, 0, 0, 0, unchecked (( sbyte )128), 0, 0, 0, unchecked (( sbyte )133), 0, 0, 0, unchecked (( sbyte )133) }, collector.PageCatalogue());
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldComputeCatalogueWhenSingleDataEntryInPage()
        public virtual void ShouldComputeCatalogueWhenSingleDataEntryInPage()
        {
            // given
            StubCollector collector = new StubCollector(4, "a", "b");

            _value.putInt(0, -1);
            collector.Visit(_key, _value);
            collector.Visit(_key, _value);
            collector.Visit(_key, _value);

            // when
            _key.putInt(0, 16);
            collector.Visit(_key, _value);
            _key.putInt(0, 32);
            collector.Visit(_key, _value);

            // then
            assertArrayEquals(new sbyte[] { 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 32, 0, 0, 0, 32 }, collector.PageCatalogue());
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldComputePageCatalogueWhenHeaderExceedsFirstPage()
        public virtual void ShouldComputePageCatalogueWhenHeaderExceedsFirstPage()
        {
            // given
            StubCollector collector = new StubCollector(4, "a", "b", "c", "d");

            _value.putInt(0, -1);
            collector.Visit(_key, _value);
            collector.Visit(_key, _value);
            collector.Visit(_key, _value);
            collector.Visit(_key, _value);
            collector.Visit(_key, _value);

            // when
            _key.putInt(0, 16);
            collector.Visit(_key, _value);
            _key.putInt(0, 32);
            collector.Visit(_key, _value);

            // then
            assertArrayEquals(new sbyte[] { 0, 0, 0, 16, 0, 0, 0, 32 }, collector.PageCatalogue());
        }