-
Notifications
You must be signed in to change notification settings - Fork 94
[REEF-1389] Add wrapper interface for DirectoryInfo and FileInfo to f… #997
Conversation
…acilitate testing for REEF-1357 JIRA: [REEF-1389](https://issues.apache.org/jira/browse/REEF-1389)
|
@afchung I am wondering what are the relation of these interfaces to the IFileSystem interface we already have. In some sense shouldn't IDirectoryInfo and IFileInfo be part of general IFileSystem interface and we just need to expand it...Or I am over generalizing? Basically, if a user comes to REEF, and looks at these interfaces will he be clear what IFileSystem is intended for and what IFileInfo and other related interfaces intended for. I will do the review once we figure out this question. @markusweimer can you also comment? |
|
@dkm2110 these interfaces are simply to allow us to perform tests by mocking out |
|
|
||
| public DateTime LastAccessTimeUtc | ||
| { | ||
| get { return _directoryInfo.LastAccessTime; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_directoryInfo.LastAccessTimeUtc?
|
@afchung Left some minor comments. Apart from that two more points: |
|
@dkm2110 for b), these interfaces and implementations will not only be used in tests, but will be used to facilitate testing. For that to work, we need to integrate it into our public facing APIs. For example when the user wants to use an For our testing, because we don't actually want to use a Such that when we test one of our functions with the parameter of an |
|
@dkm2110 I've addressed your comments, please have another look. Thanks! |
|
@afchung basically I learnt something new i.e. Nsubstitute :) ... I will test and merge later tonight. |
|
@dkm2110 what is the status on this? |
|
Testing now. |
| /// Factory method to create an <see cref="IDirectoryInfo"/> object | ||
| /// from a <see cref="DirectoryInfo"/> object. | ||
| /// </summary> | ||
| public static IDirectoryInfo FromDirectoryInfo(DirectoryInfo info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is DirectoryInfo defined? is this a standard C# class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a standard C# class.
|
I'm also confused about the role of these new classes. Do they add interfaces on top of APIs we already have? If so, all uses of the classes should be replaced with uses of the interfaces. |
|
@markusweimer They do not add interfaces on top of APIs we already have. They are a precursor to allow #994 to be unit-testable. For more explanation, see my reply do @dkm2110 above. Thanks! |
|
Is the following a fair description of this change?
|
…acilitate testing for REEF-1357 JIRA: [REEF-1389](https://issues.apache.org/jira/browse/REEF-1389) Pull Request: Closes apache#997
|
@markusweimer yes, should I reflect that message somewhere? |
|
I've copied this description to the JIRA. In case we ever wonder again :) |
…acilitate testing for REEF-1357
JIRA:
REEF-1389