Add API Framework Revel Source Files
[iec.git] / src / foundation / api / revel / cache / inmemory_test.go
1 // Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved.
2 // Revel Framework source code and usage is governed by a MIT style
3 // license that can be found in the LICENSE file.
4
5 package cache
6
7 import (
8         "testing"
9         "time"
10 )
11
12 var newInMemoryCache = func(_ *testing.T, defaultExpiration time.Duration) Cache {
13         return NewInMemoryCache(defaultExpiration)
14 }
15
16 // Test typical cache interactions
17 func TestInMemoryCache_TypicalGetSet(t *testing.T) {
18         typicalGetSet(t, newInMemoryCache)
19 }
20
21 // Test the increment-decrement cases
22 func TestInMemoryCache_IncrDecr(t *testing.T) {
23         incrDecr(t, newInMemoryCache)
24 }
25
26 func TestInMemoryCache_Expiration(t *testing.T) {
27         expiration(t, newInMemoryCache)
28 }
29
30 func TestInMemoryCache_EmptyCache(t *testing.T) {
31         emptyCache(t, newInMemoryCache)
32 }
33
34 func TestInMemoryCache_Replace(t *testing.T) {
35         testReplace(t, newInMemoryCache)
36 }
37
38 func TestInMemoryCache_Add(t *testing.T) {
39         testAdd(t, newInMemoryCache)
40 }
41
42 func TestInMemoryCache_GetMulti(t *testing.T) {
43         testGetMulti(t, newInMemoryCache)
44 }