package main

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestRegistration(t *testing.T) {
	item, err := NewItem("ram")
	require.Nil(t, err)

	c := NewClient(1, nil)

	item.Register(c)
	require.Equal(t, 1, len(item.Observers))

	item.DeRegister(c)
	require.Equal(t, 0, len(item.Observers))
}
