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

827 Коммитов

Автор SHA1 Сообщение Дата
David Tchepak 1ed714d011 Update website for 2.0.2 release 2017-02-28 10:39:24 +11:00
David Tchepak 9a7914583d Update nuget.exe to 3.5.0 2017-02-28 10:37:43 +11:00
David Tchepak 4bf6705452 2.0.2 release 2017-02-28 10:18:10 +11:00
David Tchepak 5b12e9c0e8 Updating all builds to use Castle.Core 4.0.0 2017-02-28 10:18:03 +11:00
David Tchepak 918b297887 Updating .net core build with Castle.Core 4.0 release 2017-02-28 08:45:34 +11:00
David Tchepak 7a19526431 Update changelog for #270 2017-01-05 10:02:58 +11:00
David Tchepak 818154def3 Fix NET40 build fail due to missing Task.FromResult
Reused existing workaround in SubstituteExtensions.CompletedTask<T> by
making this internal and calling from ReturnsExtensions.
2017-01-05 09:55:06 +11:00
Michael Wolfenden f8257ede4a Add ReturnsNull support for methods returning tasks 2017-01-05 09:06:23 +11:00
Christian Rondeau 492da59a56 Fix a typo (secenarios) in callbacks doc 2017-01-04 10:20:16 +11:00
David Tchepak e36a923bb2 Update changelog for #271 2017-01-04 10:09:08 +11:00
David Tchepak 6f82b2f2a4 Fix NET35 build
NET35 doesn't seem to support Expression.Variable.

Added back previous DelegateProxyFactory implementation from
ac140ef7ba for NET35 target only.

Updated test accordingingly.
2017-01-04 10:06:50 +11:00
Alexandr Nikitin 1e9e8a31d7 Reassignes delegate parameters back to ref/out parameters after the call has been routed
Fixes #271
2016-12-23 17:11:25 +02:00
Alexandr Nikitin c18003269a Add repro for #271 "Delegate substitute does not set out parameter values" 2016-12-23 14:03:46 +02:00
David Tchepak d259ef5657 Updating website downloads for 2.0.1 2016-12-17 14:00:52 +11:00
David Tchepak 289f8b28b0 2.0.1RC release 2016-12-17 13:54:19 +11:00
David Tchepak 3d6a7250c1 Updating CHANGELOG to include (#264) 2016-12-17 09:22:16 +11:00
David Tchepak e011b7134b Minor refactoring PendingSpecificationInfo and CallCollection
- Replaced InvalidOperationException with new SubstituteInternalException
  in CallCollection. Asks people to submit error to GH issues as we don't
  expect this case can happen.
- Added a fold/Handle method to PendingSpecificationInfo so we don't
  have to check each case for `null` (basically: Either<ICallSpec, ICall>).
2016-12-17 09:22:15 +11:00
Alex Povar bb06d33338 Track last call and spec in thread-safe manner #264
Rename ICallStack to ICallCollection. That is because the Pop()
method is not required more (and was deleted), and Delete()
method was added instead. That is much more collection that stack.

IPendingSpecification now holds both information about previous
call and pending specification. That is encapsulated to the
PendingSpecificationInfo. The reasons why I added one more
responsibility to this class are following:
- We always either use pending specification or information about
previous call. This data is mutually exclusive (we delete other
one when store current one). Therefore, I decided that information
about previous call is also a specification to some degree.
- It's simpler to track sources of specifications because now we
have a single place only. In my previous implementation we needed
to clear pending specification and information about last call - more
chances to fail somewhere.
- Data is stored in SubstitutionContext, so we have single field
instead of two (one for pending specification, second for last
call information).

PendingSpecificationInfo stores thread-local on SubstitutionContext
(i.e. per substitute).

GetCallSpec now uses IPendingSpecification only to resolve
specification. Therefore, I renamed the FromLastCall method
to the FromPendingSpecification because it better reflects the
method implementation.

TrackLastCallHandler introduced to set `IPendingSpecification`.
2016-12-17 09:10:41 +11:00
Alexandr Nikitin ed904cabd7 Merge pull request #265 from alexandrnikitin/fix-travisci-osx
Fix Travis CI OSX build
2016-11-23 11:05:33 +02:00
Alexandr Nikitin 2393a5ed05 Update installation of OpenSSL following the https://www.microsoft.com/net/core#macos 2016-11-23 10:57:33 +02:00
Alexandr Nikitin 5e634f7496 Merge pull request #261 from dtchepak/castlecore-4.0.0-beta002
Castlecore 4.0.0 beta002
2016-11-17 14:42:06 +02:00
David Tchepak 7f073b5d4f Ignore xmldoc warnings for dotnetcore build 2016-11-17 22:46:26 +11:00
David Tchepak 67c9e4c8cd Update Castle.Core for .NET Core build to 4.0.0-beta002 2016-11-17 22:37:52 +11:00
David Tchepak 55e8d8bf3c Update changelog for custom auto-value provders (#259)
Acknowledge work done in #234, #259, and #156.
2016-11-17 17:20:19 +11:00
Alexandr Nikitin 54a482307a Merge pull request #259 from Zvirja/add-extensibility-point-for-custom-auto-providers
Add extensibility point for custom auto providers
2016-11-16 11:40:54 +02:00
Alex Povar db8c2e0853 Add extensibility point for custom auto value providers
More precise set of changes:

- Ensure that specification evaluates original argument values,
  because they could be modified during call dispatch.

- Ensure that original arguments are used to check whether
  current call meets particular specification.

- Use own results cache for AutoValues route handler.
  That is needed to ensure that AutoValues priority isn't increased.

  Otherwise, once handler invoked for the first time,
  it's "memory" will have same priority as user configured results.
  As outcome, custom handlers, returns for type, etc will not be invoked.
2016-11-15 22:30:53 +02:00
David Tchepak 10fa6bcce8 Fix arg matcher anti-pattern example 2016-11-07 23:08:43 +11:00
David Tchepak e6170bfad5 Fixing code formatting in arg matchers docs 2016-11-07 23:04:35 +11:00
David Tchepak 88b20add55 Adding threading doc to help with #256 2016-11-07 22:51:34 +11:00
David Tchepak 4f8f2fb8b5 Updating argument matcher doc
Trying to help with #258.
2016-11-07 22:25:23 +11:00
David Tchepak f3608f0a55 Updating CHANGELOG release date 2016-08-07 12:40:42 +10:00
David Tchepak d75112eeed Updating website for release 2.0.0.0 (RC for .net core) 2016-08-07 12:14:12 +10:00
David Tchepak e1df189acd Updating build scripts to handle pre-release nuget tags
Building dotnet core package with dependency on beta of Castle.Core errors
out with:

  A stable release of a package should not have on a prerelease dependency.
  Either modify the version spec of dependency
  "Castle.Core [4.0.0-beta001, )" or update the version field.

Providing some basic support for alpha/beta/rc tags to work around this.
(Really need a better versioning/release procedure one of these days.)
2016-08-07 11:29:16 +10:00
David Tchepak 7afb26ad44 Adding build.fsx as solution item to each SLN 2016-08-07 11:15:51 +10:00
David Tchepak f12840a553 Fix typo in changelog 2016-08-07 11:07:19 +10:00
Peter Jas 9f2323f488 Add CI scripts
(DT: Record of Peter's commits got lost while merging #197.
Cherry-picked one of many commits as a marker for these
contributions.)
2016-08-07 11:06:51 +10:00
David Tchepak 3bf2bb57fd Updating changelog for #237. 2016-08-07 10:54:10 +10:00
David Tchepak cbf1a1a960 Updating changelog to include .NET Core support 2016-08-07 10:42:28 +10:00
Alexandr Nikitin 03c996eea9 Add build badges 2016-08-06 15:35:58 +03:00
Alexandr Nikitin ac140ef7ba .NET Core support (#197)
* Remove original NSubstitute project

* Add dotnet core project

* Remove unnecessary meta info

* Add Castle.Core as dependency

* Move dependencies under dontnet core framework

* Upgrade packages versions

* Add TypeExtensions based on AutoMapper code

* TypeExtensions used

* Solve some reflection issues

* Solve SerializationInfo and StreamingContext issues

* Add Collections.Concurrent package

* Seems custom dll worked

* Add System.ServiceModel assembly

* ConvertAll fix

* Remove System.ServiceModel from Net Core

* Remove System.Security.Permissions from Net Core

* Adjust TypeExtensions class

* Not DNXCORE50 condition replaced with NET4 || NET45

* Add FAKEX package to build DNX projects

* Add bat script that installs dnvm and the latest runtime

* Add draft DNX specific targets

* Remove FAKEX tools

* Add NSubstitute.NET project based on original project file to be able to test the code

* Add TypeExtensions

* Define NET35 condition constant

* Copy ilmerge.exclude

* Tests projects are back ☺️

* Fixed exception serialization for NET35

* Security and Serialization for NET35

* Finish resolving conflicts

* Port changes from "main" csproj file

* Update to the latest coreclr version

* Hardcode VS version. MSBuild I love you soooo much!!!  🐮 🐮 🐮

* Update Runtime

* Remove unused csproj

* Exclude project.lock file

* Ignore project lock

* No Serializable in .NET Core

* Move .NET Core project to a separate solution file

* Resolve merge conflicts

* Change CoreCLR version to "stable" one

* No restore stage

* Remove not used csproj

* Build only

* Add Merge task

* Add a file from the previous merge to the new .NET proj file

* Add Castle.Core alpha version

* Disable AutoQueryableProvider so far

* Remove dll wrapper. It's not needed any more

* Bump version to 2.0.0-alpha. Add package details.

* Enable Task extensions for .NET Core

* AutoTaskProvider is there for .NET Core 🎉

* Enable AutoObservableProvider for beloved .NET Core

* AutoQueryableProvider it is. Build works from Visual Studio but not from CLI. MS, I love you sooo f* much.

* No more dnx and dnvm. Long live dotnet cli. Please 🙏🙏🙏

* Dynamics in Core

* Bump the version

* Add a runner for the unit tests

* Add the Acceptance tests proj to .NET Core

* Fixing the build of the acceptance tests proj

* Better runner

* Yeah, the System.Diagnostics.TraceSource thing, of course

* Fix IsSubclassOf for .NET 🐮

* Fix dynamics for .NET Core

* Enable some tests for .NET Core

* Enable tests for .NET Core

* Bump the version to alpha003 💥

* Test runner

* Misc. fixes

* Fix reflection extensions

* Fixing the .NET 4 build

* Fix the .NET 3.5 build

* Build netstandard1.5 only

* Fix namespace

* No reason in Configuration. They handled via project.json

* Fix the build

* Revert the new API asserts

* Remove not needed file from .NET Core proj

* Remove Program.cs and emitEntryPoint from test app

* Fix test: new line char for unix

* Fix the leftover conditional

* Passes on both Windows and Ubuntu

* Add CI scripts

* Bump the version to beta

* Respond to Castle's NetCore port.
Now we don't need to import anything and have pure netcore project.
Also fixed the issue introduced by gh-238, i.e.
`ExpectedExceptionAttribute` does not exists anymore in
`NUnit.Framework`, so I wrapped it in a `Assert.Throws<Exception>`.

* Fix artifacts path in appveyor script

* FAKE build script for .NET Core

* Add a separate csproj for .NET 4 tests because they don't play well with .NET Core. For more details see:  https://github.com/dotnet/corefx/issues/4544#issuecomment-230272419

* Update FAKE. Sorry...

* Install FAKE.Dotnet

* Fixes for .NET Core artifacts

* XML docs for .NET Core

* Update NuGet

* Explicit dependencies for .NET Core

* Dependencies appear in nuspec

* Update min versions

* .gitignore VS and FAKE files

* Clean up

* Added netstandard1.5 target to build

- Added netstandard1.5 as valid target
- Skipped NETCORE_TARGETS for tasks that are currently incompatible
  (such as tests/tests against docs)
- Documented build params in "-T" task
- Hacked around with FAKE target dependencies to try to selectively build
  NET/dotnetcore projects based on targets. Had to add "soft dependencies"
  on Clean and Version to make sure that, if they are being run, they do
  so prior to build. See [1].

[1]: http://fsharp.github.io/FAKE/soft-dependencies.html

* Fixing nuspec data
2016-08-06 15:29:53 +03:00
Alexandr Nikitin 1eeb44f824 Merge pull request #238 from m3zercat/issue_237
Resolve issue 237 by wrapping method callsin try finally.
2016-07-16 18:54:53 +03:00
Matthew Malkin c086dae126 Remove duplicate test in issue 237 2016-07-16 16:40:06 +01:00
Matthew Malkin e8cf9c178b Resolve issue 237 by wrapping method callsin try finally. 2016-07-04 11:42:59 +01:00
David Tchepak 2414954ebe Adding ClearSubstitute to CHANGELOG (#159, #235, #179) 2016-06-20 18:10:15 +10:00
David Tchepak e51378d35d Made ClearSubstitutions an extension and renamed to ClearSubstitute
Moved clear to an extension to prevent bloating global intellisense.
Can add it back to main SubstituteExtensions if required later on.
Can opt-in to this with `using NSubstitute.ClearExtensions;`.

Applying suggestions from @alexandrnikitin (#179):
- Renamed ClearSubstitutions to ClearSubstitute
- Made ClearOptions.All the default
2016-06-20 18:10:07 +10:00
David Tchepak 8922d4ce76 Suggested modifications to #179
- Replaced tabs with spaces for consistency
- Renamed ClearanceFlags to ClearOptions
- CallResults.Clear cheats and creates a new queue rather than dequeuing
  each item.
- Moved flags check from SubstituteExtensions to CallRouter.
- Clearing configured results also clears ResultsForType (configured
  via ReturnsForAll<T>)
- Not obsoleting ClearReceivedCalls yet as it will be a breaking change
  if warnings-as-errors is on.
- Refactoring: CallRouter used to cache some bits of substitute state.
  Changed it to go direct to substitute state in case that value changes
  for some reason.
2016-06-20 18:08:06 +10:00
Andrew Bullock 47646e7bd1 replaced 3x clearance methods with single method and flags enum 2016-06-20 18:08:06 +10:00
Andrew Bullock f7ae8719a6 fixes #235 2016-06-20 18:07:52 +10:00
Andrew Bullock 7a5c83783a attempts to fix #157 2016-06-15 20:00:22 +01:00
David Tchepak e90132f914 Update changelog with doc fix (#231) 2016-05-31 09:52:06 +10:00