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(); }
/// <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(); }
/// <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(); }