-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.go
More file actions
32 lines (26 loc) · 694 Bytes
/
core.go
File metadata and controls
32 lines (26 loc) · 694 Bytes
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
package testingExtensions
import "testing"
// Testing interface to test unit
type Testing interface {
AssertTrue(value bool)
AssertFalse(value bool)
AssertBoolEqual(expected, value bool)
}
// TestUnit is a test unit
type TestUnit struct {
T *testing.T
}
// AssertTrue tests if a boolean is true
func (t TestUnit) AssertTrue(value bool) {
t.AssertBoolEqual(true, value)
}
// AssertFalse tests if a boolean is false
func (t TestUnit) AssertFalse(value bool) {
t.AssertBoolEqual(false, value)
}
// AssertBoolEqual tests if a boolean is equal
func (t TestUnit) AssertBoolEqual(expected, value bool) {
if value != expected {
t.T.Errorf("Expected %t but got %t", expected, value)
}
}