-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple_crud_test.go
89 lines (70 loc) · 1.93 KB
/
simple_crud_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package simple_crud_test
import (
"errors"
"testing"
)
var (
DuplicateRow = errors.New("Duplicate row.")
RowNotExist = errors.New("Row doesn't exist.")
RowUpdateFailed = errors.New("Row update failed.")
RowDeleteFailed = errors.New("Row deletion failed.")
TableNotExist = errors.New("Table doesn't exist, created just now.")
)
func TestNewDriver(t *testing.T) {
}
func TestInitDB(t *testing.T) {
}
func TestCreateRow(t *testing.T) {
t.Parallel()
type args struct {
tn string
fn string
vs string
}
tests := []struct {
name string
args args
want error
}{
{
name: "similar row exists",
args: args{
tn: "languages",
fn: "name",
vs: "indonesian",
},
want: DuplicateRow,
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
if got := CreateRow(test.args.tn, test.args.fn, test.args.vs); got != test.want {
t.Errorf("CreateRow() = %s, want %s", got, test.want)
}
})
}
}
func TestReadAllRow(t *testing.T) {
}
func TestReadRow(t *testing.T) {
}
func TestUpdateRow(t *testing.T) {
}
func TestDeleteRow(t *testing.T) {
}
/*
Go Simple CRUD is a simple database CRUD operation API with dynamic row
scanning for Go.
Copyright (C) 2022 Aranggi J. Toar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; only version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/