Files
2026-01-10 01:00:17 -08:00

34 lines
636 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package filesystem
import "io/fs"
var _ fs.DirEntry = MockFile{}
// MockFile is an implementation of fs.File for unit testing.
type MockFile struct {
MockName string
MockIsDir bool
MockType fs.FileMode
MockInfo fs.FileInfo
MockInfoErr error
}
func (m MockFile) Name() string {
return m.MockName
}
func (m MockFile) IsDir() bool {
return m.MockIsDir
}
func (m MockFile) Type() fs.FileMode {
return m.MockType
}
func (m MockFile) Info() (fs.FileInfo, error) {
return m.MockInfo, m.MockInfoErr
}