Граф коммитов

829 Коммитов

Автор SHA1 Сообщение Дата
David Tchepak 2f597b092a Updated to Castle.Core 3.1 to fix #83.
Closes #83.
2012-08-15 10:48:22 +10:00
David Tchepak 82edc3eb84 Adding repro for issue #83. 2012-08-15 10:31:37 +10:00
David Tchepak 9dcc964ff6 Updating for 1.4.2 release to fix problem on Mono. 2012-07-01 22:04:44 +10:00
David Tchepak 60486f5f83 Updating NSubstitute.csproj AfterBuild target to lookup .NET reference
assembly paths. This is to help avoid problems on machines with NET45
  installed, as it updates assemblies in the MSBuildToolsPath. This
  caused problems running on Mono, but could potentially cause other
  problems looking up types that have been moved from System.Core to
  mscorelib.

For more information see:
http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx
2012-07-01 21:15:47 +10:00
David Tchepak d48a0e4e65 Updating ILMerge to v2.11.1103 2012-06-29 22:52:49 +10:00
David Tchepak 8b0ba35b39 Updating for v1.4.1 release. 2012-06-28 17:21:00 +10:00
David Tchepak 5440844ffb Updating 7-zip command line tool
Added 7z.dll to try and get builds working without full 7-zip install.
Updated to latest 7-zip.
2012-06-28 17:14:54 +10:00
David Tchepak 1d0cd6e71c Updating to Castle.Core 3.0.0
Replaced Castle.Core 2.5.3 distrib with 3.0.0.

Dropping experimental Silverlight 3.0 support (Castle DP no longer supports
  SL30).
2012-06-22 21:53:34 +10:00
David Tchepak d32847e390 Updated changelog with nullables fix.
Closes #78.
2012-05-28 23:08:29 +10:00
David Tchepak 7c66f63012 Updated TypeCanBeNull method to account for Nullable types, which is
used by IsCompatibleWith(this object, Type) extension method.
  Thanks to Marc Gravell's StackOverflow answer for this approach:
    http://stackoverflow.com/a/1770232/906
2012-05-28 23:05:11 +10:00
Magnus Olstad Hansen bc2ae1de29 Added acceptance tests regarding nullable parameters (issue 78)
Possible fix
2012-05-28 22:45:39 +10:00
David Tchepak f235d85ffb Updating for 1.4 release 2012-05-04 21:47:24 +10:00
David Tchepak 25b699dac4 Removing Arg.Matches.
Going to try working with expressions for more complex matchers to
ease burden on devs trying to use the feature.
2012-05-04 21:42:18 +10:00
Xerxes Battiwalla 4fa50ae021 Removed doc generation as part of build deploy until TC build failures
can be solved.
2012-05-03 09:19:14 +10:00
David Tchepak 6acff1aaf0 Classifying auto-sub from Funcs as breaking change
Alerts people that some substitute delegates will now return a new sub
instead of null which may break tests, and provides instructions on how
to fix.

Hopefully tests which rely on null from a substitute func will be fairly
rare, but it seems worth alerting people to the possibility.
2012-03-21 01:40:23 +11:00
David Tchepak 85d49cd021 Fixing SL40 compile error due to no Array.ConvertAll in SL40. 2012-03-21 01:11:21 +11:00
David Tchepak 344ddeb4b7 Adding auto-sub from Func<>s to CHANGELOG and minor refactoring of DelegateCall
* Update CHANGELOG.
* Moved Type.GetMethod lookups to readonly static fields so we get the
  one-off reflection lookup (instead of per instance).
* Minor renames/moves to refresh my understanding of how this works.
* Removed DelegateCallSpecs; tested through DelegateProxyFactorySpecs.
2012-03-21 01:10:58 +11:00
Saulis d0b8ff82de Added GenericInvoke to DelegateCall; DelegateCallInvoke now has the correct return type, which allows Autosubbing delegates. 2012-03-20 23:23:39 +11:00
David Tchepak 4bd7d19783 Updated params formatting to individually format each arg and highlight
each one that does not match the specified call.

* Added ArgumentSpecification.FormatArgument(object) which delegates
  to its matcher's formatting if the matcher implements IArgumentFormatter,
  otherwise falls back to the default format provided by ArgumentFormatter.
* Updated ArrayContentsArgumentMatcher to implement IArgumentsFormatter
  and format each params argument against its respective argspec.
* Updated CallFormatter to accept pre-formatted args so it no longer has to
  dig into the spec's non-matching args. Replaced its ICallFormatter interface
  with more general IMethodFormatter (it is basically a composite method
  formatter).
* Removed ArgumentsFormatter and replaced with Join extension method.
2012-03-20 23:07:53 +11:00
Saulis c2712c3c07 Added functionality to MethodFormatter for handling Params arguments.
----------
Committer notes:
  * Squashed multiple commits to make review and commit easier.
2012-03-19 19:10:11 +11:00
David Tchepak cd89f90c8d Fixing some SL40 build issues
- SL40 target in Rakefile was broken. Added back as experimental target.
- SL40 compilation error with SL40-specific code.
- Updated SilverlightLibraryPath in csproj files to point to Reference
  Assemblies rather than specific SL build/patch version.

Thanks to Martin Hollingsworth for these fixes
(http://groups.google.com/group/nsubstitute/msg/7d0f600804f87f0a)
2012-02-03 02:22:51 +11:00
David Tchepak 8446ebdcc6 Updating sample example message in README. 2012-01-03 00:53:54 +11:00
David Tchepak 3b653bee24 Updated CHANGELOG to mention custom arg match and describer features 2012-01-03 00:43:20 +11:00
David Tchepak 1c87ef7703 Adding acceptance test for custom matcher message.
Adding line-break after non match description so descriptions don't run into each other.
2012-01-03 00:36:13 +11:00
David Tchepak 64623bf923 Hiding members of ArgumentMatchInfo that do not need to be public. 2012-01-01 18:16:04 +11:00
David Tchepak 3024d80387 Added handling of incompatible types for IDescribeNonMatches. 2011-12-30 17:48:14 +11:00
David Tchepak d9676ffe64 Adding some xmldoc to the public IArgumentMatcher and IDescribeNonMatches interfaces. 2011-12-30 12:57:59 +11:00
David Tchepak b7dcbdacfd Adding IDescribeNonMatches to allow custom IArgumentMatcher implementation
to describe why they failed to match a particular argument.

- Implemented ArgumentMatchInfo.DescribeNonMatch().
- Made GenericToNonGenericArgumentMatcher<T> implement IDescribeNonMatches
  so that it can delegate to its matcher if the matcher supports describe.
- ArgumentSpecification.DescribeNonMatch(object) returns description of
  non-match if matcher supports it, otherwise string.Empty.
- ReceivedCallsExceptionThrower responsible for indenting non-match descriptions
  appropriately.
2011-12-30 00:08:30 +11:00
David Tchepak 6570bb0725 Removing unrequired eventOperator ctor param from EventCallFormatter class. 2011-12-29 23:12:40 +11:00
David Tchepak e989506123 Adding ArgumentSpecification.DescribeNonMatch(object). 2011-12-29 23:08:28 +11:00
David Tchepak 75bf83fe38 Updated .gitignore to exclude .dotcover files. 2011-12-29 22:43:55 +11:00
David Tchepak 3a9702b18d Changed signature of CallFormatter.Format to pass ArgumentMatchInfo instead
of indicies of arguments to highlight.
2011-12-29 22:42:49 +11:00
David Tchepak 7be0b76dde Replace CallSpecification.NonMatchingArgumentIndicies(ICall) with
NonMatchingArguments(ICall) method.
2011-12-29 22:31:45 +11:00
David Tchepak c8fa47e2ab Adding ArgumentMatchInfo to describe matching between arguments and
specifications.
2011-12-29 17:30:46 +11:00
David Tchepak e593c26a39 Fixing up ToString from GenericToNonGenericArgumentMatcher so custom
arg matchers display correctly in ReceivedCallsExceptions.
2011-12-27 22:44:35 +11:00
David Tchepak 23e80d42d9 Adding test for custom arg matcher
Moved IArgumentMatcher and IArgumentMatcher<T> into root NSubstitute
  namespace as it is becoming part of the main API.
2011-12-20 23:13:36 +11:00
David Tchepak e44683729d Added test for IsCompatibleWith(this object, Type) extension method
when given a byref type.
2011-12-18 19:37:44 +11:00
David Tchepak 4fac50b977 Better encapsulated actions in ArgumentSpecification.
Action no longer exposed on IArgumentSpecification.
CallSpecification can tell ArgumentSpecification to run actions, or create
  copies of themselves that match any args with same action for compatible
  types.
2011-12-16 08:01:07 +11:00
David Tchepak fd2679d932 Making ArgumentSpecification able to create a copy of itself that matches
any args.

This moves the logic from CallSpecification and ArgumentSpecificationsFactory.
2011-12-15 22:37:15 +11:00
David Tchepak f1f137c7df Moving ArrayContentsArgumentSpecification logic into
ArrayContentsArgumentMatcher so there is only a single
  IArgumentSpecification implementation.
2011-12-14 23:10:17 +11:00
David Tchepak 3ee1028343 Adding Type.IsCompatibleWith extension method. 2011-12-07 01:00:56 +11:00
David Tchepak 017cde3cdc Pulling out argument compatiblility check from ArgumentSpecification into AnyArgumentMatcher and delegating call. 2011-12-07 01:00:55 +11:00
David Tchepak 33ea6fcf26 Adding tests for ArgumentSpecification 2011-12-07 01:00:55 +11:00
David Tchepak 9817714a89 Exposing Arg.Matches on API to support custom matchers
Removing old argument specifications and replacing with argument specification that uses matchers

Added support for byref types to MatcherArgumentSpecification and
    renamed it to ArgumentSpecification after removing for abstract
    base class.

Updated ArrayContentsArgumentSpecificaton to inherit from IArgumentSpecification
    and implemented functionality from old ArgumentSpecification abstract
    base class.

Added IArgumentMatcher<T> interface to make it easier to enqueue custom matchers.

Added ArgumentSpecificationQueue to encapsulate creating arg specs
    from matchers and queuing them in the current SubstitutionContext.
2011-12-07 01:00:54 +11:00
David Tchepak 77314f8c67 Adding IArgumentMatcher implementations to implement matching behaviour in argument specifications. 2011-12-07 01:00:53 +11:00
David Tchepak afd49e0572 Fix a race condition between checking received calls and building the exception message (#64)
Removed IReceivedCalls.FindMatchingCalls(...) and instead query from IReceivedCalls.AllCalls().
Improved thread-safety of CallStack.AllCalls() to copy ConcurrentStack before reversing and
  returning it to the caller to query.
Updated CheckReceivedCallsHandler to only access IReceivedCalls.AllCalls() once, then
  perform subsequent queries on that same copy of the data so checking
  received calls and building exception msgs are based on the same information.

Closes #64.
2011-12-07 01:00:13 +11:00
David Tchepak 1c3ec536fa Update for 1.3.0 release. 2011-11-19 22:33:43 +11:00
David Tchepak 2e9f30d961 Updating docs to include Received(count) feature
Updated sample exception messages to match new format.
Renamed references to CallNotReceivedException to ReceivedCallsException.
Added Received(x) examples to Received Calls help topic.
2011-11-10 00:50:32 +11:00
David Tchepak 05c686f768 Tweaking ReceivedCallsException messages for non-matching calls
Adding some tests around quantities and removing unrequired AtLeast(x)
  quantity.
2011-11-09 22:42:03 +11:00
David Tchepak bed45600a0 Updating changelog to include Received(times) feature. 2011-11-09 02:37:49 +11:00