Removing Null* using Testing Null* classes

This commit is contained in:
Brennan 2015-03-04 17:44:23 -08:00
parent 16f1ebe6a8
commit ca32af61a7
3 changed files with 0 additions and 67 deletions

View File

@ -1,17 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.AspNet.Routing
{
public class NullDisposable : IDisposable
{
public static NullDisposable Instance = new NullDisposable();
public void Dispose()
{
// intentionally does nothing
}
}
}

View File

@ -1,27 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.Framework.Logging;
namespace Microsoft.AspNet.Routing
{
public class NullLogger : ILogger
{
public static NullLogger Instance = new NullLogger();
public IDisposable BeginScope(object state)
{
return NullDisposable.Instance;
}
public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
{
}
public bool IsEnabled(LogLevel logLevel)
{
return false;
}
}
}

View File

@ -1,23 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.Framework.Logging;
namespace Microsoft.AspNet.Routing
{
public class NullLoggerFactory : ILoggerFactory
{
public LogLevel MinimumLevel { get; set; }
public static NullLoggerFactory Instance = new NullLoggerFactory();
public ILogger CreateLogger(string name)
{
return NullLogger.Instance;
}
public void AddProvider(ILoggerProvider provider)
{
}
}
}