Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.

Commit 657cf1b

Browse files
authored
Merge pull request #40 from osoykan/dev
dev to master
2 parents 00b078a + 7508068 commit 657cf1b

31 files changed

+200
-175
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ using (var simpleDependencyWrapper = IocManager.Instance.ResolveAsDisposable<Sim
126126
simpleDisposableDependency = simpleDependencyWrapper.Object;
127127
}
128128

129-
simpleDisposableDependency.DisposeCount.ShouldBe(1);
129+
simpleDisposableDependency.DisposeCount.Should().Be(1);
130130
```
131131

132132
Scoped resolver to avoid memory leaks:
@@ -137,7 +137,7 @@ using (IIocScopedResolver iocScopedResolver = IocManager.Instance.CreateScope())
137137
simpleDisposableDependency = iocScopedResolver.Resolve<SimpleDisposableDependency>();
138138
}
139139

140-
simpleDisposableDependency.DisposeCount.ShouldBe(1);
140+
simpleDisposableDependency.DisposeCount.Should().Be(1);
141141
```
142142

143143

common.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>3.2.0</VersionPrefix>
3+
<VersionPrefix>3.2.1</VersionPrefix>
44
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
55
<NoWarn>$(NoWarn);CS1591</NoWarn>
66
<PackageIconUrl>https://raw.githubusercontent.com/osoykan/Stove/master/stove.png</PackageIconUrl>
@@ -16,6 +16,6 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.4.0" PrivateAssets="All" />
19+
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.5.0" PrivateAssets="All" />
2020
</ItemGroup>
2121
</Project>

src/Autofac.Extras.IocManager.DynamicProxy/Autofac.Extras.IocManager.DynamicProxy.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="Autofac" Version="4.6.1" />
29+
<PackageReference Include="Autofac" Version="4.6.2" />
3030
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="4.2.1" />
31-
<PackageReference Include="Castle.Core" Version="4.2.0" />
31+
<PackageReference Include="Castle.Core" Version="4.2.1" />
3232
</ItemGroup>
3333

3434
</Project>

src/Autofac.Extras.IocManager/Autofac.Extras.IocManager.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Autofac" Version="4.6.1" />
25+
<PackageReference Include="Autofac" Version="4.6.2" />
2626
</ItemGroup>
2727
</Project>

test/Autofac.Extras.IocManager.DynamicProxy.Tests/Autofac.Extras.IocManager.DynamicProxy.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<ItemGroup>
1313
<ProjectReference Include="..\Autofac.Extras.IocManager.TestBase\Autofac.Extras.IocManager.TestBase.csproj" />
1414
<ProjectReference Include="..\..\src\Autofac.Extras.IocManager.DynamicProxy\Autofac.Extras.IocManager.DynamicProxy.csproj" />
15-
<PackageReference Include="FakeItEasy" Version="4.0.0" />
15+
<PackageReference Include="FakeItEasy" Version="4.1.0" />
1616
<PackageReference Include="NSubstitute" Version="2.0.3" />
17-
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
18-
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
17+
<PackageReference Include="FluentAssertions" Version="5.0.0-beta0003" />
18+
<PackageReference Include="xunit" Version="2.3.0" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20171012-09" />
2020
</ItemGroup>
2121

2222
</Project>

test/Autofac.Extras.IocManager.DynamicProxy.Tests/InterceptorRregister_Tests.cs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
using Castle.DynamicProxy;
88

9-
using Shouldly;
9+
using FluentAssertions;
1010

1111
using Xunit;
1212

@@ -25,8 +25,8 @@ public void interceptor_registration_with_registercallback_should_work_with_conv
2525

2626
var orderService = The<IOrderAppService>();
2727
orderService.DoSomeCoolStuff();
28-
orderService.ShouldNotBeNull();
29-
orderService.GetType().Name.ShouldContain("Proxy");
28+
orderService.Should().NotBeNull();
29+
orderService.GetType().Name.Should().Contain("Proxy");
3030
}
3131

3232
[Fact]
@@ -39,7 +39,7 @@ public void interceptor_registration_with_registercallback_should_work_with_prop
3939
});
4040

4141
var orderService = The<IOrderAppService>();
42-
orderService.ProductAppService.ShouldNotBeNull();
42+
orderService.ProductAppService.Should().NotBeNull();
4343
orderService.DoSomeCoolStuff();
4444
}
4545

@@ -59,8 +59,8 @@ public void interceptor_registration_should_work()
5959

6060
var orderService = The<IOrderAppService>();
6161
orderService.DoSomeCoolStuff();
62-
orderService.ShouldNotBeNull();
63-
orderService.GetType().Name.ShouldContain("Proxy");
62+
orderService.Should().NotBeNull();
63+
orderService.GetType().Name.Should().Contain("Proxy");
6464
}
6565

6666
[Fact]
@@ -73,28 +73,22 @@ public void multiple_interceptor_should_be_able_to_intercept_any_dependency()
7373
});
7474

7575
var orderService = The<IOrderAppService>();
76-
orderService.ProductAppService.ShouldNotBeNull();
76+
orderService.ProductAppService.Should().NotBeNull();
7777
orderService.DoSomeCoolStuff();
7878
}
7979

8080
private static void UnitOfWorkRegistrar(ComponentRegisteredEventArgs args)
8181
{
8282
Type implType = args.ComponentRegistration.Activator.LimitType;
8383

84-
if (typeof(IApplicationService).IsAssignableFrom(implType))
85-
{
86-
args.ComponentRegistration.InterceptedBy<UnitOfWorkInterceptor>();
87-
}
84+
if (typeof(IApplicationService).IsAssignableFrom(implType)) args.ComponentRegistration.InterceptedBy<UnitOfWorkInterceptor>();
8885
}
8986

9087
private static void MultipleInterceptorRegistrar(ComponentRegisteredEventArgs args)
9188
{
9289
Type implType = args.ComponentRegistration.Activator.LimitType;
9390

94-
if (typeof(IApplicationService).IsAssignableFrom(implType))
95-
{
96-
args.ComponentRegistration.InterceptedBy(typeof(UnitOfWorkInterceptor), typeof(ExceptionInterceptor));
97-
}
91+
if (typeof(IApplicationService).IsAssignableFrom(implType)) args.ComponentRegistration.InterceptedBy(typeof(UnitOfWorkInterceptor), typeof(ExceptionInterceptor));
9892
}
9993

10094
public class UnitOfWorkInterceptor : IInterceptor, ITransientDependency

test/Autofac.Extras.IocManager.MsDependencyInjection.Tests/Autofac.Extras.IocManager.MsDependencyInjection.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
<ItemGroup>
88
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
9-
<PackageReference Include="FluentAssertions" Version="5.0.0-beta0002" />
9+
<PackageReference Include="FluentAssertions" Version="5.0.0-beta0003" />
1010
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
11-
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
12-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
11+
<PackageReference Include="xunit" Version="2.3.0" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
1313
</ItemGroup>
1414

1515
<ItemGroup>
1616
<ProjectReference Include="..\..\src\Autofac.Extras.IocManager\Autofac.Extras.IocManager.csproj" />
1717
<ProjectReference Include="..\Autofac.Extras.IocManager.TestBase\Autofac.Extras.IocManager.TestBase.csproj" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20171012-09" />
1919
</ItemGroup>
2020

2121
</Project>

test/Autofac.Extras.IocManager.Tests/Autofac.Extras.IocManager.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="FakeItEasy" Version="4.0.0" />
9+
<PackageReference Include="FakeItEasy" Version="4.1.0" />
10+
<PackageReference Include="FluentAssertions" Version="5.0.0-beta0003" />
1011
<PackageReference Include="NSubstitute" Version="2.0.3" />
11-
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
12-
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
12+
<PackageReference Include="xunit" Version="2.3.0" />
13+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20171012-09" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

test/Autofac.Extras.IocManager.Tests/AutofacExtensions_Tests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44

5-
using Shouldly;
5+
using FluentAssertions;
66

77
using Xunit;
88

@@ -16,12 +16,12 @@ public void GetTypedResolvingParameters_Test()
1616
var obj = new { connectionString = "someString", dbContext = typeof(MyDbContext) };
1717

1818
IEnumerable<TypedParameter> typedParameters = obj.GetTypedResolvingParameters().ToList();
19-
typedParameters.ShouldNotBeNull();
20-
typedParameters.ShouldBeOfType<List<TypedParameter>>();
21-
typedParameters.FirstOrDefault(x => x.Type == typeof(string)).ShouldNotBeNull();
22-
typedParameters.FirstOrDefault(x => x.Type == typeof(Type)).ShouldNotBeNull();
23-
typedParameters.FirstOrDefault(x => x.Type == typeof(string)).Value.ShouldBe("someString");
24-
typedParameters.FirstOrDefault(x => x.Type == typeof(Type)).Value.ShouldBe(typeof(MyDbContext));
19+
typedParameters.Should().NotBeNull();
20+
typedParameters.Should().BeOfType<List<TypedParameter>>();
21+
typedParameters.FirstOrDefault(x => x.Type == typeof(string)).Should().NotBeNull();
22+
typedParameters.FirstOrDefault(x => x.Type == typeof(Type)).Should().NotBeNull();
23+
typedParameters.FirstOrDefault(x => x.Type == typeof(string)).Value.Should().Be("someString");
24+
typedParameters.FirstOrDefault(x => x.Type == typeof(Type)).Value.Should().Be(typeof(MyDbContext));
2525
}
2626

2727
private class MyDbContext

test/Autofac.Extras.IocManager.Tests/AutofacServiceRegistration_Tests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Shouldly;
1+
using FluentAssertions;
22

33
using Xunit;
44

@@ -42,8 +42,8 @@ public void Assert_Service()
4242
IRootResolver resolver = _sut.CreateResolver();
4343
var magicInterface = resolver.Resolve<IMagicInterface>();
4444

45-
magicInterface.ShouldNotBeNull();
46-
magicInterface.ShouldBeAssignableTo<MagicClass>();
45+
magicInterface.Should().NotBeNull();
46+
magicInterface.Should().BeAssignableTo<MagicClass>();
4747
}
4848

4949
[Fact]
@@ -87,11 +87,11 @@ public void Assert_Decorator()
8787
IRootResolver resolver = _sut.CreateResolver();
8888
var magic = resolver.Resolve<IMagicInterface>();
8989

90-
magic.ShouldBeAssignableTo<MagicClassDecorator2>();
90+
magic.Should().BeAssignableTo<MagicClassDecorator2>();
9191
var magicClassDecorator2 = (MagicClassDecorator2)magic;
92-
magicClassDecorator2.Inner.ShouldBeAssignableTo<MagicClassDecorator1>();
92+
magicClassDecorator2.Inner.Should().BeAssignableTo<MagicClassDecorator1>();
9393
var magicClassDecorator1 = (MagicClassDecorator1)magicClassDecorator2.Inner;
94-
magicClassDecorator1.Inner.ShouldBeAssignableTo<MagicClass>();
94+
magicClassDecorator1.Inner.Should().BeAssignableTo<MagicClass>();
9595
}
9696

9797
private interface IMagicInterface

0 commit comments

Comments
 (0)