public void CreateReturnsSameInstance() { var logger1 = NullLogger.GetInstance(); var logger2 = NullLogger.GetInstance(); logger2.Equals(logger1).ShouldBeTrue(); }
/// <summary> /// Creates a new Router object /// </summary> public Router() { RegisteredRoutes = new List <IRoute>(); Logger = NullLogger.GetInstance(); Scanner = new RouteScanner(); Scope = string.Empty; }
/// <summary> /// Returns a new Router object /// </summary> public Router() { _routingTable = new List <IRoute>(); Logger = NullLogger.GetInstance(); Scanner = new RouteScanner(); Scope = string.Empty; }
/// <summary> /// Creates a new Router object /// </summary> public Router() { RegisteredRoutes = new List <IRoute>(); RouteCache = new ConcurrentDictionary <string, IList <IRoute> >(); Logger = NullLogger.GetInstance(); Scanner = new RouteScanner(); Scope = string.Empty; }
public ServerSettings() { PublicFolders = new List <IPublicFolder>(); Host = "localhost"; Logger = NullLogger.GetInstance(); Port = "1234"; Router = new Router(); UseHttps = false; }
public ServerSettings() { Connections = 50; Host = "localhost"; Logger = NullLogger.GetInstance(); Port = "1234"; PublicFolder = new PublicFolder(); Router = new Router(); UseHttps = false; }
public ServerSettings() { PublicFolders = new List <IPublicFolder>(); Connections = 50; Host = "localhost"; Logger = NullLogger.GetInstance(); Port = "1234"; Router = new Router(); UseHttps = false; DependencyResolver = new ContainerBuilder(); }
internal RouteScanner() { Logger = NullLogger.GetInstance(); _excludedNamespaces = new List <string>(); _includedNamespaces = new List <string>(); _excludedTypes = new List <Type>(); _includedTypes = new List <Type>(); _excludedAssemblies = new List <Assembly>(); _includedAssemblies = new List <Assembly>(); }
public void CreateInitializesLoggerOnFirstAccess() { var field = typeof(NullLogger).GetField("_logger", BindingFlags.Static | BindingFlags.NonPublic); field.SetValue(null, null); field.GetValue(null).ShouldBeNull(); var logger1 = NullLogger.GetInstance(); field.GetValue(null).ShouldNotBeNull(); var logger2 = NullLogger.GetInstance(); logger2.Equals(logger1).ShouldBeTrue(); }
internal RouteScanner() { Logger = NullLogger.GetInstance(); _excludedNamespaces = new List <string>() { #if NETSTANDARD "Microsoft.VisualStudio.TestPlatform.ObjectModel" #endif }; _includedNamespaces = new List <string>(); _excludedTypes = new List <Type>(); _includedTypes = new List <Type>(); _excludedAssemblies = new List <Assembly>(); _includedAssemblies = new List <Assembly>(); }
public void PropogatesToScanner() { var scanner = new RouteScanner(); scanner.Logger.ShouldBeOfType <NullLogger>(); var router = new Router { Scanner = scanner }; router.Logger.ShouldBeOfType <NullLogger>(); router.Logger = new InMemoryLogger(); router.Logger.ShouldBeOfType <InMemoryLogger>(); scanner.Logger.ShouldBeOfType <InMemoryLogger>(); router.Scanner = null; Should.NotThrow(() => router.Logger = NullLogger.GetInstance()); }
public void AllMethodsDoNothing() { const string msg = "Log Message"; var obj = new object(); var ex = new Exception(); var logger = NullLogger.GetInstance(); logger.Log(new LogEvent()); logger.Debug(obj); logger.Debug(msg); logger.Debug(msg, ex); logger.Error(obj); logger.Error(msg); logger.Error(msg, ex); logger.Fatal(obj); logger.Fatal(msg); logger.Fatal(msg, ex); logger.Info(obj); logger.Info(msg); logger.Info(msg, ex); logger.Warn(obj); logger.Warn(msg); logger.Warn(msg, ex); logger.Trace(obj); logger.Trace(msg); logger.Trace(msg, ex); logger.Level.ShouldBe(LogLevel.Trace); }