Skip to content

Commit 88183c1

Browse files
committed
Enable .NET Core UT
1 parent 56559d4 commit 88183c1

32 files changed

+121
-130
lines changed

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ dotnet_csproj:
2222
cache:
2323
- C:\ProgramData\chocolatey\bin -> appveyor.yml
2424
- C:\ProgramData\chocolatey\lib -> appveyor.yml
25-
- '%LocalAppData%\NuGet\v3-cache'
25+
- '%LocalAppData%\NuGet\v3-cache -> **\*.csproj'
2626

2727
before_build:
28-
- nuget restore -Verbosity quiet
28+
- dotnet restore --verbosity quiet
2929
- choco install opencover.portable
3030
- choco install codecov
3131

3232
build:
3333
verbosity: minimal
3434

3535
test_script:
36-
- OpenCover.Console.exe -register:user -target:"%xunit20%\xunit.console.x86.exe" -targetargs:".\src\Ninject.Extensions.Interception.Test\bin\Release\net452\Ninject.Extensions.Interception.Tests.dll -noshadow -parallel none" -filter:"+[Ninject.Extensions.Interception*]* -[Ninject.Extensions.Interception.Test*]*" -output:".\Ninject.Extensions.Interception_coverage.xml"
36+
- OpenCover.Console.exe -oldstyle -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test --configuration Release --no-build src\Ninject.Extensions.Interception.Test" -filter:"+[Ninject.Extensions.Interception*]* -[Ninject.Extensions.Interception.Test*]*" -excludebyattribute:*.ExcludeFromCodeCoverage*;*.Obsolete* -output:"Ninject.Extensions.Interception_coverage.xml"
3737
- codecov -f "Ninject.Extensions.Interception_coverage.xml
3838

3939
artifacts:

src/Ninject.Extensions.Interception.DynamicProxy/Ninject.Extensions.Interception.DynamicProxy.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
<ItemGroup>
3939
<PackageReference Include="Castle.Core" Version="4.1.1" />
40-
<PackageReference Include="Ninject" Version="3.3.0" />
4140
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
4241
<PrivateAssets>All</PrivateAssets>
4342
</PackageReference>

src/Ninject.Extensions.Interception.LinFu/Ninject.Extensions.Interception.LinFu.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
<ItemGroup>
3939
<PackageReference Include="LinFu.DynamicProxy.OfficialRelease" Version="1.0.5" />
40-
<PackageReference Include="Ninject" Version="3.3.0" />
4140
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
4241
<PrivateAssets>All</PrivateAssets>
4342
</PackageReference>

src/Ninject.Extensions.Interception.Test/AsyncInterceptionContextLinFu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !NET_35 && !SILVERLIGHT
1+
#if !NETCOREAPP2_0
22
namespace Ninject.Extensions.Interception
33
{
44
public class AsyncInterceptionContextLinFu : AsyncInterceptionContext

src/Ninject.Extensions.Interception.Test/AutoNotifyPropertyChangedContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Ninject.Extensions.Interception
44

55
public abstract class AutoNotifyPropertyChangedContext : InterceptionTestContext
66
{
7-
public AutoNotifyPropertyChangedContext()
7+
protected AutoNotifyPropertyChangedContext()
88
{
99
this.Kernel = this.CreateDefaultInterceptionKernel();
1010
this.PropertyChanges = new List<string>();

src/Ninject.Extensions.Interception.Test/AutoNotifyPropertyChangedContextLinFu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !SILVERLIGHT
1+
#if !NETCOREAPP2_0
22

33
namespace Ninject.Extensions.Interception
44
{

src/Ninject.Extensions.Interception.Test/AutoNotifyPropertyClassProxyContext.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public AutoNotifyPropertyClassProxyContext()
1212
this.ViewModel = this.Kernel.Get<ViewModelWithClassNotify>();
1313
this.ViewModel.PropertyChanged += (o, e) =>
1414
{
15-
LastPropertyToChange = e.PropertyName;
16-
PropertyChanges.Add(LastPropertyToChange);
15+
this.LastPropertyToChange = e.PropertyName;
16+
this.PropertyChanges.Add(this.LastPropertyToChange);
1717
};
1818
}
1919

@@ -23,23 +23,23 @@ public AutoNotifyPropertyClassProxyContext()
2323
public void WhenValueChangesOnPropertyWithoutNotifyAttribute_ItShouldNotifyChanges()
2424
{
2525
this.ViewModel.Address = "123 Main Street";
26-
LastPropertyToChange.Should().Be("Address");
26+
this.LastPropertyToChange.Should().Be("Address");
2727
}
2828

2929
[Fact]
3030
public void WhenValueChangesOnPropertyWithDependentProperties_ItShouldNotifyAllChanges()
3131
{
3232
this.ViewModel.ZipCode = 9700;
33-
PropertyChanges[0].Should().Be("ZipCode");
34-
PropertyChanges[1].Should().Be("City");
35-
PropertyChanges[2].Should().Be("State");
33+
this.PropertyChanges[0].Should().Be("ZipCode");
34+
this.PropertyChanges[1].Should().Be("City");
35+
this.PropertyChanges[2].Should().Be("State");
3636
}
3737

3838
[Fact]
3939
public void WhenPropertyHasDoNotNotifyAttribute_ChangNotificationIsSuppressed()
4040
{
4141
this.ViewModel.DoNotNotifyChanges = "...";
42-
LastPropertyToChange.Should().BeNull();
42+
this.LastPropertyToChange.Should().BeNull();
4343
}
4444
}
4545
}

src/Ninject.Extensions.Interception.Test/AutoNotifyPropertyClassProxyContextDynamicProxy2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected override InterceptionModule InterceptionModule
1919
[Fact]
2020
public void WhenAutoNotifyAttributeIsAttachedToAClass_TheObjectIsProxied()
2121
{
22-
typeof(IProxyTargetAccessor).IsAssignableFrom(ViewModel.GetType()).Should().BeTrue();
22+
typeof(IProxyTargetAccessor).IsAssignableFrom(this.ViewModel.GetType()).Should().BeTrue();
2323
}
2424
}
2525
}

src/Ninject.Extensions.Interception.Test/AutoNotifyPropertyClassProxyContextLinFu.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !SILVERLIGHT
1+
#if !NETCOREAPP2_0
22
namespace Ninject.Extensions.Interception
33
{
44
using FluentAssertions;
@@ -19,7 +19,7 @@ protected override InterceptionModule InterceptionModule
1919
[Fact]
2020
public void WhenAutoNotifyAttributeIsAttachedToAClass_TheObjectIsProxied()
2121
{
22-
typeof(IProxy).IsAssignableFrom(ViewModel.GetType()).Should().BeTrue();
22+
typeof(IProxy).IsAssignableFrom(this.ViewModel.GetType()).Should().BeTrue();
2323
}
2424
}
2525
}

src/Ninject.Extensions.Interception.Test/AutoNotifyPropertyDetectChangesInterceptorContext.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ public abstract class AutoNotifyPropertyDetectChangesInterceptorContext : AutoNo
99
{
1010
public AutoNotifyPropertyDetectChangesInterceptorContext()
1111
{
12-
ViewModel = Kernel.Get<ViewModel>();
13-
ViewModel.PropertyChanged += (o, e) =>
12+
this.ViewModel = this.Kernel.Get<ViewModel>();
13+
this.ViewModel.PropertyChanged += (o, e) =>
1414
{
15-
LastPropertyToChange = e.PropertyName;
16-
PropertyChanges.Add(LastPropertyToChange);
15+
this.LastPropertyToChange = e.PropertyName;
16+
this.PropertyChanges.Add(this.LastPropertyToChange);
1717
};
1818

19-
ComplexViewModel = Kernel.Get<ComplexViewModel>();
20-
ComplexViewModel.PropertyChanged += (o, e) =>
19+
this.ComplexViewModel = this.Kernel.Get<ComplexViewModel>();
20+
this.ComplexViewModel.PropertyChanged += (o, e) =>
2121
{
22-
LastPropertyToChange = e.PropertyName;
23-
PropertyChanges.Add(LastPropertyToChange);
22+
this.LastPropertyToChange = e.PropertyName;
23+
this.PropertyChanges.Add(this.LastPropertyToChange);
2424
};
2525
}
2626

@@ -31,44 +31,44 @@ public AutoNotifyPropertyDetectChangesInterceptorContext()
3131
[Fact]
3232
public void WhenValueAssignedIsTheSameAsTheCurrentValue_ItShouldNotNotify()
3333
{
34-
ViewModel.ZipCode = 0;
35-
LastPropertyToChange.Should().BeNull();
34+
this.ViewModel.ZipCode = 0;
35+
this.LastPropertyToChange.Should().BeNull();
3636
}
3737

3838
[Fact]
3939
public void WhenValueAssignedIsTheSameAsTheCurrentComplexValue_ItShouldNotNotify()
4040
{
4141
var value = new ComplexType();
42-
ComplexViewModel.Complex = value; // initialize
43-
LastPropertyToChange.Should().Be("Complex");
44-
LastPropertyToChange = null;
42+
this.ComplexViewModel.Complex = value; // initialize
43+
this.LastPropertyToChange.Should().Be("Complex");
44+
this.LastPropertyToChange = null;
4545
var newValue = new ComplexType();
46-
ComplexViewModel.Complex = newValue; // test
47-
LastPropertyToChange.Should().BeNull();
46+
this.ComplexViewModel.Complex = newValue; // test
47+
this.LastPropertyToChange.Should().BeNull();
4848
}
4949

5050
[Fact]
5151
public void WhenValueAssignedIsNotTheSameAsTheCurrentComplexValue_ItShouldNotNotify()
5252
{
5353
var value = new ComplexType();
54-
ComplexViewModel.Complex = value; // initialize
55-
LastPropertyToChange.Should().Be("Complex");
56-
LastPropertyToChange = null;
54+
this.ComplexViewModel.Complex = value; // initialize
55+
this.LastPropertyToChange.Should().Be("Complex");
56+
this.LastPropertyToChange = null;
5757
var newValue = new ComplexType {Name = "Foo"};
58-
ComplexViewModel.Complex = newValue; // test
59-
LastPropertyToChange.Should().Be("Complex");
58+
this.ComplexViewModel.Complex = newValue; // test
59+
this.LastPropertyToChange.Should().Be("Complex");
6060
}
6161

6262
[Fact]
6363
public void WhenPropertySubValueAssignedIsNotTheSameAsTheCurrentComplexValue_ItShouldNotNotify()
6464
{
6565
var value = new ComplexType();
66-
ComplexViewModel.Complex = value; // initialize
67-
LastPropertyToChange.Should().Be("Complex");
68-
LastPropertyToChange = null;
66+
this.ComplexViewModel.Complex = value; // initialize
67+
this.LastPropertyToChange.Should().Be("Complex");
68+
this.LastPropertyToChange = null;
6969
var newValue = new ComplexType {Simple = new SimpleType {Id = 5}};
70-
ComplexViewModel.Complex = newValue; // test
71-
LastPropertyToChange.Should().Be("Complex");
70+
this.ComplexViewModel.Complex = newValue; // test
71+
this.LastPropertyToChange.Should().Be("Complex");
7272
}
7373
}
7474
}

0 commit comments

Comments
 (0)