func TestExifGetDatetimeOsErrorReturnNil(t *testing.T) { OsInterfaceMockReturnFile, OsInterfaceMockReturnError = os.Open("bad_file") if focusfs.ExifGetDatetime( &OsInterfaceMock{}, &ExifInterfaceMock{}, "test") != nil { t.Error("bad file should mean nil back") } }
func TestExifGetDatetimeHappyPath(t *testing.T) { OsInterfaceMockReturnFile, OsInterfaceMockReturnError = os.Open("empty_file") ExifInterfaceMockReturnExif = &exif.Exif{} ExifInterfaceMockReturnError = nil if focusfs.ExifGetDatetime( &OsInterfaceMock{}, &ExifInterfaceMock{}, "test") != nil { t.Error("Exif data not returns as expected") } }
func TestExifGetDatetimeExifErrorReturnsNil(t *testing.T) { OsInterfaceMockReturnFile, OsInterfaceMockReturnError = os.Open("empty_file") ExifInterfaceMockReturnExif = &exif.Exif{} ExifInterfaceMockReturnError = errors.New("blah blah blah") if focusfs.ExifGetDatetime( &OsInterfaceMock{}, &ExifInterfaceMock{}, "test") != nil { t.Error("Bad exif response should return nil") } }