Exemplo n.º 1
0
        public void LoadConfigByJson()
        {
            using (var installationContext = new ConfigurationContext())
            {
                installationContext.Database.OpenConnection();
                var builder = new JsonObjectLoader();
                IEnumerable <GameConfiguration> result;
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();
                try
                {
                    result = builder.LoadAllObjects <EntityFramework.GameConfiguration>(installationContext).ToList();
                }
                finally
                {
                    stopwatch.Stop();
                }

                Assert.That(result, Is.Not.Null);
                Assert.That(result.Count, Is.Not.EqualTo(0));
                Assert.That(stopwatch.ElapsedMilliseconds, Is.EqualTo(0));
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CachingGameConfigurationRepository" /> class.
 /// </summary>
 /// <param name="repositoryManager">The repository manager.</param>
 /// <param name="logger">The logger for this class.</param>
 public CachingGameConfigurationRepository(RepositoryManager repositoryManager, ILogger <CachingGameConfigurationRepository> logger)
     : base(repositoryManager, logger)
 {
     this.objectLoader = new GameConfigurationJsonObjectLoader();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameConfigurationRepository"/> class.
 /// </summary>
 /// <param name="repositoryManager">The repository manager.</param>
 public GameConfigurationRepository(IRepositoryManager repositoryManager)
     : base(repositoryManager)
 {
     this.objectLoader = new JsonObjectLoader();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameConfigurationRepository"/> class.
 /// </summary>
 /// <param name="contextProvider">The context provider.</param>
 public GameConfigurationRepository(PersistenceContextProvider contextProvider)
     : base(contextProvider)
 {
     this.objectLoader = new GameConfigurationJsonObjectLoader();
 }