We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6165fc5 commit a1092afCopy full SHA for a1092af
database/query_builder_test.go
@@ -2,17 +2,35 @@ package database
2
3
import (
4
"github.com/icinga/icinga-go-library/testutils"
5
+ "strconv"
6
"testing"
7
)
8
9
type MockEntity struct {
- Entity
10
- Id int
+ Id Id
11
Name string
12
Age int
13
Email string
14
}
15
16
+type Id int
17
+
18
+func (i Id) String() string {
19
+ return strconv.Itoa(int(i))
20
+}
21
22
+func (m MockEntity) ID() ID {
23
+ return m.Id
24
25
26
+func (m MockEntity) SetID(id ID) {
27
+ m.Id = id.(Id)
28
29
30
+func (m MockEntity) Fingerprint() Fingerprinter {
31
+ return m
32
33
34
func TestInsertStatement(t *testing.T) {
35
tests := []testutils.TestCase[string, testutils.InsertStatementTestData]{
36
{
0 commit comments