Uh oh!
There was an error while loading. Please reload this page.
[REEF-1389] Add wrapper interface for DirectoryInfo and FileInfo to f… - #997
[REEF-1389] Add wrapper interface for DirectoryInfo and FileInfo to f…#997afchung wants to merge 2 commits into
Conversation
…acilitate testing for REEF-1357 JIRA: [REEF-1389](https://issues.apache.org/jira/browse/REEF-1389)
dkm2110
commented
May 12, 2016
@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? |
afchung
commented
May 12, 2016
@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.
_directoryInfo.LastAccessTimeUtc?
dkm2110
commented
May 13, 2016
@afchung Left some minor comments. Apart from that two more points: |
afchung
commented
May 13, 2016
@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 |
afchung
commented
May 13, 2016
@dkm2110 I've addressed your comments, please have another look. Thanks! |
dkm2110
commented
May 14, 2016
@afchung basically I learnt something new i.e. Nsubstitute :) ... I will test and merge later tonight. |
afchung
commented
May 16, 2016
@dkm2110 what is the status on this? |
dkm2110
commented
May 16, 2016
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.
Where is DirectoryInfo defined? is this a standard C# class?
There was a problem hiding this comment.
Yes, this is a standard C# class.
markusweimer
commented
May 16, 2016
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. |
afchung
commented
May 16, 2016
@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! |
markusweimer
commented
May 16, 2016
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: Closesapache#997
afchung
commented
May 17, 2016
@markusweimer yes, should I reflect that message somewhere? |
markusweimer
commented
May 17, 2016
I've copied this description to the JIRA. In case we ever wonder again :) |
…acilitate testing for REEF-1357
JIRA:
REEF-1389