package main

import (
	"github.com/gogf/gf/encoding/gjson"
	"testing"
)

func TestNewShadowStoreService(t *testing.T) {
	s := NewShadowStoreService()
	s.SaveStatus("123", gjson.New(`{"status": {"power": 2}}`))
	doc, err := s.GetStatus("123")
	if err != nil {
		t.Fatal(err)
	}
	s.SaveCommand("123", gjson.New(`{"cmd":"powerControl","params":{"power":1,"temp":2}}`))
	t.Log(doc.MustToJsonString())
}
