Implemented ShouldRenderFileContents and deprecated ShouldRenderFile#23
Implemented ShouldRenderFileContents and deprecated ShouldRenderFile#23robdmoore merged 6 commits intoTestStack:masterfrom AlexArchive:master
Conversation
|
Looks good. I think checking content type before checking the content itself makes sense though. Thoughts?
|
|
I thought about this briefly earlier and decided that it feels more natural to throw exceptions according to the order of the arguments. I also ordered the conditional tests in this way because I applied similar logic previously to the I do not have any strong feelings one way or the other, though. Let me know what you want me to do. Thanks for the comments :) |
|
Consistency is important and throwing in the order of the args makes sense. The only thing I'm wondering is it it makes it easier from a debugging point of view to see the wrong content type before knowing that something about the byte[] is wrong? |
|
What you say makes a lot of sense to me now. You are saying that an invalid content type has the potential to set red flag as it were - testing the content type first could prevent the developer from being lead down the garden path. I will refactor now :) |
|
Yep - makes sense |
|
Should I refactor the |
|
Sure, these methods are new so the breaking change shouldn't matter right? |
|
Cool. I'll unlist that one and deploy again when your changes are in :) |
Partial implementation of #3
|
btw - if you could adjust the readme/docs to add the new methods that would be awesome :) |
|
I tweaked the order of the tests and added some unit-tests to document the behaviour. I also snuck in another commit - improved formatting for the test message. |
Sure. I will do that when issue #3 is closed. Only the filestream test overloads to go. I am going to comment on the actual issue now. |
|
Great work! |
Implemented ShouldRenderFileContents and deprecated ShouldRenderFile
|
1.0.23 is deployed to nuget |

I have implemented the
ShouldRenderFileContentsmethod and it's relevant overloads and I have marked theShouldRenderFilemethod as obsolete.I did not implement support for the overload that takes a string. I want to implement that overload but first I would like to validate that this code is correct.
Thanks.