package cache_test import ( "testing" m "fiskerinc.com/modules/common" "fiskerinc.com/modules/cache" "github.com/stretchr/testify/assert" ) var ( dtc = m.DTC_ECU{ VIN: "3FAFP13P71R199432", ECU: "ACU", TroubleCode: 8388881, } ) func TestSetAndExists(t *testing.T) { carDtcCache := cache.NewCarDTCsCache(1000) exists := carDtcCache.Exists(dtc) assert.Equal(t, exists, false) carDtcCache.Set(dtc) exists = carDtcCache.Exists(dtc) assert.Equal(t, exists, true) }