-
Notifications
You must be signed in to change notification settings - Fork 199
/
directoryReaderStub.go
40 lines (32 loc) · 1.06 KB
/
directoryReaderStub.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
package mock
// DirectoryReaderStub -
type DirectoryReaderStub struct {
ListFilesAsStringCalled func(directoryPath string) ([]string, error)
ListDirectoriesAsStringCalled func(directoryPath string) ([]string, error)
ListAllAsStringCalled func(directoryPath string) ([]string, error)
}
// ListFilesAsString -
func (d *DirectoryReaderStub) ListFilesAsString(directoryPath string) ([]string, error) {
if d.ListAllAsStringCalled != nil {
return d.ListAllAsStringCalled(directoryPath)
}
return nil, nil
}
// ListDirectoriesAsString -
func (d *DirectoryReaderStub) ListDirectoriesAsString(directoryPath string) ([]string, error) {
if d.ListDirectoriesAsStringCalled != nil {
return d.ListDirectoriesAsStringCalled(directoryPath)
}
return nil, nil
}
// ListAllAsString -
func (d *DirectoryReaderStub) ListAllAsString(directoryPath string) ([]string, error) {
if d.ListAllAsStringCalled != nil {
return d.ListAllAsStringCalled(directoryPath)
}
return nil, nil
}
// IsInterfaceNil -
func (d *DirectoryReaderStub) IsInterfaceNil() bool {
return d == nil
}