Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Date functions #23

Merged
merged 2 commits into from
Feb 6, 2014
Merged

Added Date functions #23

merged 2 commits into from
Feb 6, 2014

Conversation

xt0rted
Copy link
Contributor

@xt0rted xt0rted commented Feb 1, 2014

this is for review while I work through adding the rest of the functions in


if (!typeof(DateTime).IsAssignableFrom(childexpression.Type) && !typeof(DateTimeOffset).IsAssignableFrom(childexpression.Type))
{
throw new Exception("Type does not support the 'day' function.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these perform this check? what about throwing an exception?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think this is valid... the exception handling in Linq to Querystring generally at the moment is not good so any improvements are welcomed! There are a few test files called 'Exceptions.cs' which verify these, so might be good to update those as well.

@xt0rted
Copy link
Contributor Author

xt0rted commented Feb 3, 2014

I added in a new exception type and unit tests to verify it gets thrown. I wasn't sure how detailed to get with those so I just ran them against a single string type.

I also rebased to cleanup the commit history.

@xt0rted
Copy link
Contributor Author

xt0rted commented Feb 3, 2014

I forgot to mention that locally I updated MSpec to the latest beta. This was the only way I could get resharper to run my tests since I have v8.1 installed. The MSTest runner was horrible and wouldn't run the tests right. If there's any inconsistencies between my tests and yours this is most likely why. If you'd like a PR for these changes I can submit another since I already made them.

@beyond-code-github
Copy link
Owner

Cool, here goes nothing!

beyond-code-github pushed a commit that referenced this pull request Feb 6, 2014
@beyond-code-github beyond-code-github merged commit 4c69419 into beyond-code-github:master Feb 6, 2014
@beyond-code-github
Copy link
Owner

I seem to be having troubles with Mspec since the pull, it can't seem to find any of the assertion extension methods! Would this be related to the latest beta?

@xt0rted
Copy link
Contributor Author

xt0rted commented Feb 6, 2014

The issue is probably due to how they're restructuring the MSpec project. I Had to add Machine.Specifications.Should to get the assertion methods back. In there they had ShouldBeOfType<T>() marked as obsolete and to use ShouldBeOfExactType<T>() instead, which is what I did. That'll teach me to update my local dependencies only.

If it helps here's the changes I made to update MSpec #24

@beyond-code-github
Copy link
Owner

Thanks! And congratulations for sending the first (and second) pull request for the project :)

@xt0rted xt0rted deleted the date-functions branch May 22, 2017 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants