Skip to content

Commit af2193e

Browse files
Merge pull request #87 from jbatte47/release/3.9.2
Release/3.9.2
2 parents 627d063 + 38f3103 commit af2193e

16 files changed

Lines changed: 310 additions & 5 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ipch/
5555

5656
# ReSharper is a .NET coding add-in
5757
_ReSharper*
58-
*.dotsettings
58+
*.dotsettings.user
5959

6060
# NCrunch
6161
*.ncrunch*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Welcome!
77
Here are the highlights:
88

99
* This is the official codebase used for [NuGet distributions of Patterns](https://nuget.org/packages?q=id%3A+Patterns%3B+author%3A+%22John+Batte%22).
10-
* Check the [official code patterns site](http://jbatte47.github.io/code-patterns/) for API documenation and additional information.
10+
* Check the [official code patterns site](http://jbatte47.github.io/code-patterns/) for API documentation and additional information.
1111
* Head over to [the wiki](https://github.com/jbatte47/code-patterns/wiki) for user-contributed content.
1212
* You can also check out [the license file](https://github.com/jbatte47/code-patterns/blob/master/license.txt "FreeBSD (2-Clause)") if you're wondering about that.
1313

src/Patterns.Testing.Autofac/Moq/AutofacMoqContainer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
using Moq;
3030

3131
using Patterns.Autofac;
32+
using Patterns.ExceptionHandling;
3233
using Patterns.Testing.Moq;
3334

3435
namespace Patterns.Testing.Autofac.Moq
@@ -70,7 +71,7 @@ public AutofacMoqContainer() : this(new ContainerBuilder().Build()) {}
7071
/// </returns>
7172
public Mock<TService> Mock<TService>() where TService : class
7273
{
73-
var service = Create<TService>();
74+
var service = Try.Get(() => Create<TService>());
7475
var existingMock = service as IMocked<TService>;
7576
if (existingMock != null) return existingMock.Mock;
7677

src/Patterns.Testing.Autofac/Patterns.Testing.Autofac.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@
9999
<Project>{367EAA3A-FABB-4CFB-AF01-AD0A4F0499FD}</Project>
100100
<Name>Patterns.Testing</Name>
101101
</ProjectReference>
102+
<ProjectReference Include="..\Patterns\Patterns.csproj">
103+
<Project>{2BC41806-D0BF-4993-B342-CC7A3EDDF313}</Project>
104+
<Name>Patterns</Name>
105+
</ProjectReference>
102106
</ItemGroup>
103107
<ItemGroup>
104108
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />

src/Patterns.Testing.Autofac/Patterns.Testing.Autofac.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<owners>$author$</owners>
77
<projectUrl>https://github.com/jbatte47/code-patterns</projectUrl>
88
<dependencies>
9+
<dependency id="Patterns" version="$version$" />
910
<dependency id="Patterns.Autofac" version="$version$" />
1011
<dependency id="Patterns.Testing" version="$version$" />
1112
</dependencies>

src/Patterns.Testing.Autofac/Patterns.Testing.Autofac.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ output extension=".nuspec" #><?xml version="1.0"?>
88
<owners>$author$</owners>
99
<projectUrl>https://github.com/jbatte47/code-patterns</projectUrl>
1010
<dependencies>
11+
<dependency id="Patterns" version="$version$" />
1112
<dependency id="Patterns.Autofac" version="$version$" />
1213
<dependency id="Patterns.Testing" version="$version$" />
1314
</dependencies>

src/Patterns/SolutionAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
[assembly: AssemblyCulture("")]
3232
[assembly: ComVisible(false)]
3333
[assembly: NeutralResourcesLanguage("en-US")]
34-
[assembly: AssemblyVersion("3.9.1")]
34+
[assembly: AssemblyVersion("3.9.2")]

src/Patterns/SolutionAssemblyInfo.settings.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Settings.Initialize(
33
majorNumber: 3,
44
minorNumber: 9,
5-
patchNumber: 1,
5+
patchNumber: 2,
66
buildNumber: null,
77
buildLevel: BuildLevels.None
88
);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Feature: Autofac Moq Container
2+
In order to be able to easily get a mixture of mocked and registered objects
3+
As a unit or integration test developer
4+
I want to have a container that seamlessly blends Autofac with Moq
5+
6+
Background:
7+
Given I have an Autofac/Moq test container
8+
9+
Scenario: Create an unregistered object
10+
When I create an object using the test container
11+
Then the test container should have given me an object
12+
And the object retrieved by the test container should be a mock-based type
13+
14+
Scenario: Create a registered object
15+
When I register an object with the test container
16+
And I create an object using the test container
17+
Then the test container should have given me an object
18+
And the object retrieved by the test container should not be a mock-based type
19+
20+
Scenario: Override a registered object
21+
When I register an object with the test container
22+
And I create an object using the test container
23+
Then the test container should have given me an object
24+
And the object retrieved by the test container should not be a mock-based type
25+
26+
When I create a mock of the object using the test container
27+
And I create an object using the test container
28+
Then the test container should have given me an object
29+
And the test container should have given me a mock of the object
30+
And the object retrieved by the test container should be a mock-based type

src/_specs/Features/Testing/Moq/Autofac/AutofacMoqContainer.feature.cs

Lines changed: 150 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)