diff --git a/appveyor.yml b/appveyor.yml index b7de442c..1d18c4ed 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,11 +30,12 @@ before_build: - choco install codecov build: + parallel: true verbosity: minimal test_script: - cd src\Ninject.Test - - OpenCover.Console.exe -oldstyle -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"xunit -nobuild -quiet" -filter:"+[Ninject]*" -output:"..\..\Ninject_coverage.xml" + - OpenCover.Console.exe -oldstyle -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"xunit -configuration Release -nobuild" -filter:"+[Ninject]*" -output:"Ninject_coverage.xml" - codecov -f "Ninject_coverage.xml" artifacts: diff --git a/src/Ninject.Test/Integration/ActivationStrategyTests.cs b/src/Ninject.Test/Integration/ActivationStrategyTests.cs index 86960db1..e5286e1c 100644 --- a/src/Ninject.Test/Integration/ActivationStrategyTests.cs +++ b/src/Ninject.Test/Integration/ActivationStrategyTests.cs @@ -1,5 +1,6 @@ namespace Ninject.Tests.Integration { + using System; using System.Linq; using FluentAssertions; @@ -8,7 +9,7 @@ using Ninject.Tests.Fakes; using Xunit; - public class ActivationStrategyTests + public class ActivationStrategyTests : IDisposable { private readonly StandardKernel kernel; diff --git a/src/Ninject.Test/Integration/ConstructorArgumentInBindingConfigurationBuilderTest.cs b/src/Ninject.Test/Integration/ConstructorArgumentInBindingConfigurationBuilderTest.cs index ad2bf9e8..ff9cb434 100644 --- a/src/Ninject.Test/Integration/ConstructorArgumentInBindingConfigurationBuilderTest.cs +++ b/src/Ninject.Test/Integration/ConstructorArgumentInBindingConfigurationBuilderTest.cs @@ -20,11 +20,12 @@ //------------------------------------------------------------------------------- namespace Ninject.Tests.Integration { + using System; using FluentAssertions; using Ninject.Tests.Fakes; using Xunit; - public class ConstructorArgumentInBindingConfigurationBuilderTest + public class ConstructorArgumentInBindingConfigurationBuilderTest : IDisposable { private readonly StandardKernel kernel; diff --git a/src/Ninject.Test/Integration/ConstructorArgumentTests.cs b/src/Ninject.Test/Integration/ConstructorArgumentTests.cs index d1670e07..3638afd0 100644 --- a/src/Ninject.Test/Integration/ConstructorArgumentTests.cs +++ b/src/Ninject.Test/Integration/ConstructorArgumentTests.cs @@ -80,7 +80,7 @@ public void Dispose() [Theory] - [MemberData("ConstructorArguments")] + [MemberData(nameof(ConstructorArguments))] public void ConstructorArgumentsArePassedToFirstLevel(Func constructorArgument) { this.kernel.Bind().To(); @@ -103,7 +103,7 @@ public void ConstructorArgumentsArePassedToFirstLevel(Func constructorArgument) { this.kernel.Bind().To(); @@ -114,7 +114,7 @@ public void ConstructorArgumentsAreNotInheritedIfNotSpecified(Func constructorArgument) { this.kernel.Bind().To(); diff --git a/src/Ninject.Test/Integration/ConstructorSelectionTests.cs b/src/Ninject.Test/Integration/ConstructorSelectionTests.cs index c24acb72..48262eb0 100644 --- a/src/Ninject.Test/Integration/ConstructorSelectionTests.cs +++ b/src/Ninject.Test/Integration/ConstructorSelectionTests.cs @@ -10,7 +10,7 @@ namespace Ninject.Tests.Integration using Xunit; - public class ConstructorSelectionTests + public class ConstructorSelectionTests : IDisposable { private readonly StandardKernel kernel; diff --git a/src/Ninject.Test/Integration/DefaultParameterTests.cs b/src/Ninject.Test/Integration/DefaultParameterTests.cs index fa749bf4..e65a5cf0 100644 --- a/src/Ninject.Test/Integration/DefaultParameterTests.cs +++ b/src/Ninject.Test/Integration/DefaultParameterTests.cs @@ -1,11 +1,12 @@ #if !SILVERLIGHT namespace Ninject.Tests.Integration { + using System; using FluentAssertions; using Ninject.Tests.Fakes; using Xunit; - public class DefaultParameterTests + public class DefaultParameterTests : IDisposable { private readonly StandardKernel kernel; diff --git a/src/Ninject.Test/Unit/CachePruningTests.cs b/src/Ninject.Test/Unit/CachePruningTests.cs index d691a497..4ffbf0a0 100644 --- a/src/Ninject.Test/Unit/CachePruningTests.cs +++ b/src/Ninject.Test/Unit/CachePruningTests.cs @@ -21,11 +21,6 @@ public class WhenPruneIsCalled private Cache cache; public WhenPruneIsCalled() - { - this.SetUp(); - } - - public void SetUp() { this.cachePrunerMock = new Mock(); this.bindingConfigurationMock = new Mock(); diff --git a/src/Ninject.Test/Unit/ExtensionsForMemberInfoTest.cs b/src/Ninject.Test/Unit/ExtensionsForMemberInfoTest.cs index 6c4e520a..bcac8eba 100644 --- a/src/Ninject.Test/Unit/ExtensionsForMemberInfoTest.cs +++ b/src/Ninject.Test/Unit/ExtensionsForMemberInfoTest.cs @@ -35,7 +35,7 @@ public void GetCustomAttributesExtended() this.TestGetCustomAttributesExtended("ProtectedProperty"); this.TestGetCustomAttributesExtended("PrivateProperty"); } - + [Fact] public void GetCustomAttributesExtendedForAttributesOnBaseClass() { @@ -57,19 +57,11 @@ public void IndexerHasAttribute() this.TestIndexerHasAttribute(typeof(InheritedPropertyAttributeTest), typeof(int), typeof(NotInheritedInjectAttribute), false); } - public void TestIndexerHasAttribute(Type testObjectType, Type indexerType, Type attributeType, bool expectedResult) + private void TestIndexerHasAttribute(Type testObjectType, Type indexerType, Type attributeType, bool expectedResult) { -#if !WINRT var propertyInfo = testObjectType.GetProperties() .First(pi => pi.Name == "Item" && pi.GetIndexParameters().Single().ParameterType == indexerType); -#else - var propertyInfo = - testObjectType.GetRuntimeProperties() - .First(pi => pi.Name == "Item" && pi.GetIndexParameters() - .Single() - .ParameterType == indexerType); -#endif var hasInjectAttribute = propertyInfo.HasAttribute(attributeType); @@ -130,7 +122,7 @@ private void TestHasAttributeForAttributesOnBaseClass(string propertyName) this.TestHasAttribute(propertyAttributeClass, propertyName, typeof(NotInheritedInjectAttribute), false); this.TestHasAttribute(propertyAttributeClass, propertyName, typeof(NamedAttribute), false); } - + private void TestHasAttribute(object testObject, string attributeName, Type attributeType, bool expectedValue) { #if !WINRT @@ -141,17 +133,17 @@ private void TestHasAttribute(object testObject, string attributeName, Type attr .GetRuntimeProperties() .Single(pi => pi.Name == attributeName); #endif - + bool hasAttribute = propertyInfo.HasAttribute(attributeType); hasAttribute.Should().Be(expectedValue); } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = true, Inherited = false)] - public class NotInheritedInjectAttribute : InjectAttribute + public sealed class NotInheritedInjectAttribute : InjectAttribute { } - + public class PropertyAttributeTest { [Inject] @@ -234,7 +226,7 @@ public override object this[int name] { } } - } + } } #endif } \ No newline at end of file