Skip to content

Commit

Permalink
Add codecov; clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-xu committed Sep 23, 2017
1 parent 1a7d498 commit 767da0d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 64 deletions.
9 changes: 7 additions & 2 deletions appveyor.yml
Expand Up @@ -20,14 +20,19 @@ dotnet_csproj:
package_version: '{version}'

before_build:
- cmd: nuget restore -Verbosity quiet
- nuget restore -Verbosity quiet
- choco install opencover.portable
- choco install codecov

build:
verbosity: minimal

test_script:
- OpenCover.Console.exe -register:user -target:"%xunit20%\xunit.console.x86.exe" -targetargs:".\src\Ninject.Test\bin\Release\net452\Ninject.Test.dll -noshadow" -filter:"+[Ninject*]* -[Ninject.Test*]*" -output:".\Ninject_coverage.xml"
- codecov -f "Ninject_coverage.xml

artifacts:
- path: '**\*.nupkg'
name: 'Ninject NuGet Package'

deploy:
provider: NuGet
Expand Down
59 changes: 1 addition & 58 deletions src/Ninject/Infrastructure/Introspection/FormatExtensions.cs
Expand Up @@ -23,19 +23,6 @@ namespace Ninject.Infrastructure.Introspection
/// </summary>
public static class FormatExtensions
{
#if NO_MEMBERTYPE
private enum MemberTypes
{
Field,
Event,
Constructor,
Property,
Method,
NestedType,
TypeInfo,
}
#endif

/// <summary>
/// Formats the activation path into a meaningful string representation.
/// </summary>
Expand Down Expand Up @@ -144,11 +131,7 @@ public static string Format(this ITarget target)
{
using (var sw = new StringWriter())
{
#if !NO_MEMBERTYPE
switch (target.Member.MemberType)
#else
switch (target.Member.GetMemberType())
#endif
{
case MemberTypes.Constructor:
sw.Write("parameter {0} of constructor", target.Name);
Expand All @@ -166,9 +149,8 @@ public static string Format(this ITarget target)
throw new ArgumentOutOfRangeException();
}

#if !NO_REFLECTEDTYPE
sw.Write(" of type {0}", target.Member.ReflectedType.Format());
#endif

return sw.ToString();
}
}
Expand All @@ -182,17 +164,10 @@ public static string Format(this Type type)
{
var friendlyName = GetFriendlyName(type);

#if !MONO
if (friendlyName.Contains("AnonymousType"))
{
return "AnonymousType";
}
#else
if (friendlyName.Contains("__AnonType"))
{
return "AnonymousType";
}
#endif

switch (friendlyName.ToLowerInvariant())
{
Expand Down Expand Up @@ -296,37 +271,5 @@ private static void AppendGenericArguments(StringBuilder sb, Type[] genericArgum

sb.Append("}");
}

#if NO_MEMBERTYPE
private static MemberTypes GetMemberType(this MemberInfo member)
{
if (member is FieldInfo)
{
return MemberTypes.Field;
}

if (member is ConstructorInfo)
{
return MemberTypes.Constructor;
}

if (member is PropertyInfo)
{
return MemberTypes.Property;
}

if (member is EventInfo)
{
return MemberTypes.Event;
}

if (member is MethodInfo)
{
return MemberTypes.Method;
}

return MemberTypes.TypeInfo;
}
#endif
}
}
2 changes: 0 additions & 2 deletions src/Ninject/Infrastructure/StandardScopeCallbacks.cs
Expand Up @@ -26,11 +26,9 @@ public class StandardScopeCallbacks
/// </summary>
public static readonly Func<IContext, object> Singleton = ctx => ctx.Kernel;

#if !NO_THREAD_SCOPE
/// <summary>
/// Gets the callback for thread scope.
/// </summary>
public static readonly Func<IContext, object> Thread = ctx => System.Threading.Thread.CurrentThread;
#endif
}
}
4 changes: 2 additions & 2 deletions src/Ninject/Syntax/ModuleLoadExtensions.cs
Expand Up @@ -39,7 +39,7 @@ public static void Load(this IKernel kernel, params INinjectModule[] modules)
kernel.Load(modules);
}

#if !NO_ASSEMBLY_SCANNING
#if !NO_ASSEMBLY_SCANNING
/// <summary>
/// Loads modules from the files that match the specified pattern(s).
/// </summary>
Expand All @@ -59,6 +59,6 @@ public static void Load(this IKernel kernel, params Assembly[] assemblies)
{
kernel.Load(assemblies);
}
#endif
#endif
}
}

0 comments on commit 767da0d

Please sign in to comment.