Storm ArtistRepository and PropertyRepository complete.

This commit is contained in:
Deluan
2020-01-10 16:13:07 -05:00
committed by Deluan Quintão
parent aebb960831
commit 0ca691b37f
11 changed files with 92 additions and 27 deletions
@@ -0,0 +1,30 @@
package storm
import (
"github.com/cloudsonic/sonic-server/domain"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PropertyRepository", func() {
var repo domain.PropertyRepository
BeforeEach(func() {
Db().Drop(propertyBucket)
repo = NewPropertyRepository()
})
It("saves and retrieves data", func() {
Expect(repo.Put("1", "test")).To(BeNil())
Expect(repo.Get("1")).To(Equal("test"))
})
It("returns default if data is not found", func() {
Expect(repo.DefaultGet("2", "default")).To(Equal("default"))
})
It("returns value if found", func() {
Expect(repo.Put("3", "test")).To(BeNil())
Expect(repo.DefaultGet("3", "default")).To(Equal("test"))
})
})