You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: chain_kv_test.go
    path of file: ./repos/chainlink/core/chains
    
    the code of the file until where you have to start completion: package chains_test

import (
	"context"
	"math/big"
	"testing"

	"github.com/stretchr/testify/assert"

	"github.com/smartcontractkit/chainlink-common/pkg/types"
	"github.com/smartcontractkit/chainlink/v2/core/chains"
)

func Test_ChainKV(t *testing.T) {
	var (
		testChainID = "id"
		testChain   = &testChainService{name: "test chain"}
	)
	// test empty case
	empty := make(map[string]*testChainService)
	kv := chains.NewChainsKV[*testChainService](empty)
	c, err := kv.Get(testChainID)
	assert.Nil(t, c)
	assert.ErrorIs(t, err, chains.ErrNoSuchChainID)

	assert.Equal(t, kv.Len(), 0)
	assert.Len(t, kv.Slice(), 0)

	cs, err := kv.List()
	assert.NoError(t, err)
	assert.Len(t, cs, 0)

	// test with one chain
	onechain := map[string]*testChainService{test
    
func Test_ChainKV(t *testing.T) {
	var (
		testChainID = "id"
		testChain   = &testChainService{name: "test chain"}
	)
	// test empty case
	empty := make(map[string]*testChainService)
	kv := chains.NewChainsKV[*testChainService](empty)
	c, err := kv.Get(testChainID)
	assert.Nil(t, c)
	assert.ErrorIs(t, err, chains.ErrNoSuchChainID)

	assert.Equal(t, kv.Len(), 0)
	assert.Len(t, kv.Slice(), 0)

	cs, err := kv.List()
	assert.NoError(t, err)
	assert.Len(t, cs, 0)

	// test with one chain
	onechain := map[string]*testChainService{testChainID: testChain}
	kv = chains.NewChainsKV[*testChainService](onechain)
	c, err = kv.Get(testChainID)
	assert.Equal(t, c, testChain)
	assert.NoError(t, err)

	assert.Equal(t, kv.Len(), 1)
	assert.Len(t, kv.Slice(), 1)

	cs, err = kv.List()
	assert.NoError(t, err)
	assert.Len(t, cs, 1)

	//List explicit chain
	cs, err = kv.List(testChainID)
	assert.NoError(t, err)
	assert.Len(t, cs, 1)
	assert.Equal(t, testChain, cs[0])

	//List no such id
	cs, err = kv.List("no such id")
	assert.Error(t, err)
	assert.Len(t, cs, 0)
}