Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
31
pkg/cache/car_dtcs_test.go
vendored
Normal file
31
pkg/cache/car_dtcs_test.go
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user