LCOV - code coverage report
Current view: top level - Ninject/Cqrs.Ninject.MongoDB - TestMongoDataStoreConnectionStringFactory.cs Hit Total Coverage
Test: doc-coverage.info Lines: 0 5 0.0 %
Date: 2017-07-26

          Line data    Source code
       1             : #region Copyright
       2             : // // -----------------------------------------------------------------------
       3             : // // <copyright company="cdmdotnet Limited">
       4             : // //   Copyright cdmdotnet Limited. All rights reserved.
       5             : // // </copyright>
       6             : // // -----------------------------------------------------------------------
       7             : #endregion
       8             : 
       9             : using System.Configuration;
      10             : using System.Runtime.Remoting.Messaging;
      11             : using Cqrs.MongoDB.Events;
      12             : using Cqrs.MongoDB.Factories;
      13             : 
      14             : namespace Cqrs.Ninject.MongoDB
      15             : {
      16             :         public class TestMongoDbDataStoreConnectionStringFactory
      17             :                 : IMongoDbDataStoreConnectionStringFactory
      18             :                 , IMongoDbEventStoreConnectionStringFactory
      19           0 :         {
      20             :                 private const string MongoDbConnectionStringKey = "MongoDb-Test";
      21             : 
      22             :                 private const string CallContextDatabaseNameKey = "MongoDataStoreConnectionStringFactory¿DatabaseName";
      23             : 
      24             :                 public static string DatabaseName
      25             :                 {
      26             :                         get
      27             :                         {
      28             :                                 return (string)CallContext.GetData(CallContextDatabaseNameKey);
      29             :                         }
      30             :                         set
      31             :                         {
      32             :                                 CallContext.SetData(CallContextDatabaseNameKey, value);
      33             :                         }
      34             :                 }
      35             : 
      36             :                 #region Implementation of IMongoDataStoreConnectionStringFactory
      37             : 
      38           0 :                 public string GetDataStoreConnectionString()
      39             :                 {
      40             :                         return ConfigurationManager.ConnectionStrings[MongoDbConnectionStringKey].ConnectionString;
      41             :                 }
      42             : 
      43           0 :                 public string GetDataStoreDatabaseName()
      44             :                 {
      45             :                         return DatabaseName;
      46             :                 }
      47             : 
      48             :                 #endregion
      49             : 
      50             :                 #region Implementation of IMongoDbEventStoreConnectionStringFactory
      51             : 
      52           0 :                 public string GetEventStoreConnectionString()
      53             :                 {
      54             :                         return GetDataStoreConnectionString();
      55             :                 }
      56             : 
      57           0 :                 public string GetEventStoreDatabaseName()
      58             :                 {
      59             :                         return GetDataStoreDatabaseName();
      60             :                 }
      61             : 
      62             :                 #endregion
      63             :         }
      64             : }

Generated by: LCOV version 1.10