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

WIP: FAKE it til you make it #138

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Build/samples.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="'$(Configuration)|$(Platform)' != 'AllBuild|AnyCPU' "/>
<ItemGroup>
<Reference Include="NSubstitute.dll" />
<Reference Include="nunit.framework.dll" />
<CSFile Include="*.cs" />
</ItemGroup>
<Target Name="Build">
<Csc
Sources="@(CSFile)"
References="@(Reference)"
OutputAssembly="NSubstitute.Samples.dll"
TargetType="library" />
</Target>
</Project>
41 changes: 22 additions & 19 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,57 +1,60 @@
1.7.1 (January 2014)
### 1.8.0 (January 2014)
* [UPDATE] Move along nothing to see here

### 1.7.1 (January 2014)
* [FIX] Ambiguous arg exception with out/ref parameters. Thanks to Alexandr Nikitin. (#129)

1.7.0 (January 2014)
### 1.7.0 (January 2014)
* [NEW] Partial subs (Substitute.ForPartsOf<T>()). Thanks to Alexandr Nikitin for tonnes of hard work on this feature (and for putting up with a vacillating project owner :)).
* [UPDATE] Received.InOrder moved out of Experimental namespace.
* [FIX] Argument matching with optional parameters. Thanks to Peter Wiles. (#111)
* [FIX] Argument matching with out/ref. Thanks to Kevin Bosman. (#111)
* [FIX] The default return value for any call that returns a concrete type that is purely virtual, but also has at least one public static method in it will be a substitute rather than null. Thanks to Robert Moore (@robdmoore) for this contribution. (#118)

1.6.1 (June 2013)
### 1.6.1 (June 2013)
* [FIX] Detect and throw on type mismatches in Returns() caused by Returns(ConfigureOtherSub()).
* [FIX] Support raising exceptions that do not implement a serialisation constructor (#110). Thanks to Alexandr Nikitin for this contribution.

1.6.0 (April 2013)
### 1.6.0 (April 2013)
* [NEW] .AndDoes() method for chaining a callback after a Returns(). (#98)
* [FIX] Handling calls with params argument of value types, thanks to Eric Winkler.
* [FIX] Can now substitute for interfaces implementing System.Windows.IDataObject, thanks to Johan Appelgren.
* [UPDATE] Improved XML doc comments, thanks to David Gardiner.

1.5.0 (January 2013)
### 1.5.0 (January 2013)
* [EXPERIMENTAL] Asserting ordered call sequences
* [FIX] Arg.Invoke with four arguments now passes fourth arg correctly (#88). Thanks to Ville Salonen (@VilleSalonen) for finding and patching this.
* [FIX] Substitute objects now use actual implementation for base object methods (Equals, GetHashCode, ToString). Thanks to Robert Moore (@robdmoore) for this contribution. (#77)
* [NEW] Auto-substitute for Task/Task<T>. Task<T> will use substitute rules that T would use. Thanks to Jake Ginnivan (@JakeGinnivan) for this contribution.
* [NEW] Match derived types for generic calls (#97). Thanks to Iain Ballard for this contribution.
* [NEW] Returns now supports passing multiple callbacks, which makes it easier to combine stubbing multiple return values followed by throwing an exception (#99). Thanks to Alexandr Nikitin for this contribution.

1.4.3 (August 2012)
### 1.4.3 (August 2012)
* [FIX] Updated to Castle.Core 3.1.0 to fix an issue proxying generic methods with a struct constraint (#83).

1.4.2 (July 2012)
### 1.4.2 (July 2012)
* [FIX] Issue using NET40 build on Mono (due to NET45 build tools incompatibility)

1.4.1 (June 2012)
### 1.4.1 (June 2012)
* [FIX] Fix matching Nullable<T> arguments when arg value is null. Thanks to Magnus Olstad Hansen (@maggedotno) for this contribution. (#78)
* [UPDATE] Updated to Castle.Core 3.0.0.

1.4.0 (May 2012)
### 1.4.0 (May 2012)
* [NEW] [BREAKING] Auto-substitute for types returned from substitutes of delegates/Funcs (follows same auto-substitute rules as for methods and properties). Thanks to Sauli T�hk�p�� for implementing this feature. (#52)
* [NEW] Show details of params arguments when displaying received calls. Thanks to Sauli T�hk�p�� for implementing this feature. (#65)
* [FIX] Race condition between checking received calls and building the exception could cause nonsensical exception messages like "Expected 5, actually received 5" when called concurrently. (#64)

1.3.0 (Nov 2011)
### 1.3.0 (Nov 2011)
* [NEW] Support for Received(times) to assert a call was received a certain number of times. Thanks to Abi Bellamkonda for this contribution. (#63)
* [FIX] Improved support for calling substitutes from multiple threads. (#62)

1.2.1 (Oct 2011)
### 1.2.1 (Oct 2011)
* [FIX] Some combinations of Arg.Do and Returns() caused incorrect values to be returned. (#59)
* [UPDATE] WCF ServiceContractAttribute no longer applied to proxies. (#60)
* [FIX] Passing null could cause argument actions to fail. (#61)
* [FIX] Calls to virtual methods from constructors of classes being substituted for are no longer recorded, to prevent non-obvious behaviour when calling Returns() on an auto-substituted value. (#57)

1.2.0 (Sep 2011)
### 1.2.0 (Sep 2011)
* [NEW] Arg.Do() syntax for capturing arguments passed to a method and performing some action with them whenever the method is called.
* [NEW] Arg.Invoke() syntax for invoking callbacks passed as arguments to a method whenever the method is called.
* [NEW] Basic support for setting out/ref parameters.
Expand All @@ -61,15 +64,15 @@
* [FIX] Failure to match calls with ref arguments using ReceivedWithAnyArgs().
* [FIX] Incorrect ambiguous args exception when supplying value type arg specs for object arguments.

1.1.0 (May 2011)
### 1.1.0 (May 2011)
* [UPDATE] Updated to Castle.Core 2.5.3.
* [FIX] Fixed bug when raising a delegate event with a null argument.
* [FIX] CallInfo.Arg<T>() now works more reliably, including for null arguments.
* [FIX] Better exception when accidentally calling substitute extension method with a null reference (e.g. foo.Received().Call() when foo is null)
* [UPDATE] Exceptions thrown in custom argument matchers (Arg.Is<T>(x => ...)) will now silently fail to match the argument, rather than allowing exceptions to bubble up.
* [NEW] Support for test fixtures run in parallel.

1.0.0 (Dec 2010)
### 1.0.0 (Dec 2010)
* [FIX] Using Returns(null) for value types throws, rather than returning default(T).

0.9.5 Release Candidate
Expand All @@ -88,11 +91,11 @@
* [FIX] Can substitute for SynchronizationContext in .NET4 (fixed in Castle.Core)
* [NEW] NSubstitute available as NuPack package

0.9.0 Beta 1
### 0.9.0 Beta 1
* [FIX] Now handles argument specifiers used for params arguments correctly
* [UPDATE] Updated to Castle.Core 2.5 final.

0.1.3 alpha 4
### 0.1.3 alpha 4
* [NEW] Support auto/recursive substituting for members that return interfaces or delegates.
* [NEW] Support auto substituting for members that return arrays and strings (return empty values rather than null).
* [NEW] Raise.Event<TEventArgs>() will now attempt to construct arguments with default ctors, so in most cases they will not need to be explictly provided.
Expand All @@ -102,16 +105,16 @@
* [FIX] Throw correct exception when raising an event and event handler throws. (Fix by Rodrigo Perera)
* [FIX] Record call as received when it throws an exception from the When..Do callback.

0.1.2 alpha 3
### 0.1.2 alpha 3
* [NEW] Marked non-matching parameters in the actual calls listed for CallNotReceivedException messages.
* [NEW] Added WhenForAnyArgs..Do syntax for callbacks.
* [UPDATE] Updated arg matching to be smarter when matchers are not used for all args.
* [FIX] Fixed bug when substituting for delegates with multiple parameters.
* [FIX] Removed redundant cast operator which sometimes caused the compiler trouble in resolving Raise.Event().

0.1.1 alpha 2
### 0.1.1 alpha 2
* [NEW] Added ReturnsForAnyArgs() extension methods
* [FIX] Compiled for Any CPU to run on x64 platforms

0.1.0 alpha
### 0.1.0 alpha
* Initial release
35 changes: 14 additions & 21 deletions Source/NSubstitute/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
using System.Reflection;
// <auto-generated/>
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("NSubstitute")]
[assembly: AssemblyDescription("A simple substitute for .NET mocking frameworks.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NSubstitute")]
[assembly: AssemblyCopyright("Copyright © 2009 NSubstitute Team")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f1571463-8354-493c-b67c-cd9cec9adf78")]

[assembly: AssemblyTitleAttribute("NSubstitute")]
[assembly: AssemblyDescriptionAttribute("A simple substitute for .NET mocking frameworks.")]
[assembly: GuidAttribute("f1571463-8354-493c-b67c-cd9cec9adf78")]
[assembly: AssemblyProductAttribute("NSubstitute")]
[assembly: AssemblyCopyrightAttribute("Copyright \u00A9 2009 NSubstitute Team")]
[assembly: AssemblyVersionAttribute("1.8.0.0")]
[assembly: AssemblyFileVersionAttribute("1.8.0.0")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "1.8.0.0";
}
}
Binary file added ThirdParty/FAKE/FAKE.Core/FAKE.Core.nupkg
Binary file not shown.
Binary file added ThirdParty/FAKE/FAKE.Core/tools/FAKE.exe
Binary file not shown.
16 changes: 16 additions & 0 deletions ThirdParty/FAKE/FAKE.Core/tools/FAKE.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.3.1.0" />
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.3.1.0" />
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading