github.com/oinume/lekcije@v0.0.0-20231017100347-5b4c5eb6ab24/backend/model/stat_notifier_test.go (about)

     1  package model
     2  
     3  import (
     4  	"testing"
     5  	"time"
     6  
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  func TestStatNotifierService_CreateOrUpdate(t *testing.T) {
    11  	//a := assert.New(t)
    12  	r := require.New(t)
    13  	helper.TruncateAllTables(t)
    14  
    15  	//user1 := helper.CreateUser("test1", "test1@gmail.com")
    16  	statNotifier := &StatNotifier{
    17  		Datetime:             time.Now().UTC(),
    18  		Interval:             10,
    19  		Elapsed:              100000,
    20  		UserCount:            800,
    21  		FollowedTeacherCount: 1600,
    22  	}
    23  	err := statNotifierService.CreateOrUpdate(statNotifier)
    24  	r.NoError(err)
    25  }