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

Commit

Permalink
references are reorganized
Browse files Browse the repository at this point in the history
  • Loading branch information
osoykan committed Aug 30, 2017
1 parent c5d0e65 commit 0a3f8d6
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@
<PackageTags>Autofac;DynamicProxy;Resolve;Composition Root</PackageTags>
<Description>DynamicProxy integration for Autofac.Extras.IocManager</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<None Update="bin\Release\net452\Autofac.Extras.IocManager.DynamicProxy.pdb">
<None Include="bin\Release\net452\Autofac.Extras.IocManager.DynamicProxy.pdb">
<PackagePath>lib/net452/</PackagePath>
<Pack>true</Pack>
</None>
<None Update="bin\Release\netstandard1.6\Autofac.Extras.IocManager.DynamicProxy.pdb">
<None Include="bin\Release\netstandard1.6\Autofac.Extras.IocManager.DynamicProxy.pdb">
<PackagePath>lib/netstandard1.6/</PackagePath>
<Pack>true</Pack>
</None>
Expand All @@ -36,13 +31,4 @@
<PackageReference Include="Castle.Core" Version="4.1.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="NETStandard.Library" Version="1.6.1" />
</ItemGroup>

</Project>
19 changes: 2 additions & 17 deletions src/Autofac.Extras.IocManager/Autofac.Extras.IocManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@
<Description>Provides abstractions to Autofac's registration and resolvings.</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<None Update="bin\Release\net452\Autofac.Extras.IocManager.pdb">
<None Include="bin\Release\net452\Autofac.Extras.IocManager.pdb">
<PackagePath>lib/net452/</PackagePath>
<Pack>true</Pack>
</None>
<None Update="bin\Release\netstandard1.6\Autofac.Extras.IocManager.pdb">
<None Include="bin\Release\netstandard1.6\Autofac.Extras.IocManager.pdb">
<PackagePath>lib/netstandard1.6/</PackagePath>
<Pack>true</Pack>
</None>
Expand All @@ -29,14 +24,4 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="4.6.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="NETStandard.Library" Version="1.6.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public void GetTypedResolvingParameters_Test()
typedParameters.FirstOrDefault(x => x.Type == typeof(string)).ShouldNotBeNull();
typedParameters.FirstOrDefault(x => x.Type == typeof(Type)).ShouldNotBeNull();
typedParameters.FirstOrDefault(x => x.Type == typeof(string)).Value.ShouldBe("someString");
;
typedParameters.FirstOrDefault(x => x.Type == typeof(Type)).Value.ShouldBe(typeof(MyDbContext));
;
}

private class MyDbContext
Expand Down
38 changes: 38 additions & 0 deletions test/Autofac.Extras.IocManager.Tests/Lamda_Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;

using Autofac.Extras.IocManager.TestBase;

using Shouldly;

using Xunit;

namespace Autofac.Extras.IocManager.Tests
{
public class Lamda_Tests : TestBaseWithIocBuilder
{
public Lamda_Tests()
{
Building(builder => { builder.RegisterServices(r => { r.Register<Func<string, string>>(context => (s => s.ToLower())); }); });
}

[Fact]
public void funcs_are_registered()
{
The<Func<string, string>>().ShouldNotBeNull();

using (ILifetimeScope scope = The<ILifetimeScope>().BeginLifetimeScope("message", x => x.Register<Func<int, int>>(ctx => (i =>
{
i = i * i;
return i;
}))))
{
scope.Resolve<Func<int, int>>().Invoke(4).ShouldBe(16);

using (ILifetimeScope beginLifetimeScope = scope.BeginLifetimeScope())
{
beginLifetimeScope.Resolve<Func<string, string>>().Invoke("A").ShouldBe("a");
}
}
}
}
}

0 comments on commit 0a3f8d6

Please sign in to comment.