Example #1
0
        public void Test_S2CellUnion_RefuseToDecode()
        {
            List <S2CellId> cellids = new();
            S2CellId        id      = S2CellId.Begin(S2.kMaxCellLevel);

            for (int i = 0; i <= S2CellUnion.Union_decode_max_num_cells; ++i)
            {
                cellids.Add(id);
                id = id.Next();
            }
            S2CellUnion cell_union = S2CellUnion.FromVerbatim(cellids);
            Encoder     encoder    = new();

            cell_union.Encode(encoder);
            var decoder = encoder.Decoder();

            var(success, _) = S2CellUnion.Decode(decoder);
            Assert.False(success);
        }