コード例 #1
0
 /// <summary>
 /// Make sure we can at least store profiler results to the http runtime cache.
 /// </summary>
 internal static void EnsureStorageStrategy()
 {
     if (Storage == null)
     {
         Storage = new DummyStorage();
     }
 }
コード例 #2
0
        public void OuterServicesRedirected()
        {
            var dummyMessagingImplementation = new DummyMessaging();

            DummyMessagingHashCode = dummyMessagingImplementation.GetHashCode();

            var dummyStorageImplementation = new DummyStorage();

            DummyStorageHashCode = dummyStorageImplementation.GetHashCode();

            var serviceProvider = new ServiceCollection()
                                  .AddSingleton <IMessagingInfrastructure>(r => dummyMessagingImplementation)
                                  .AddSingleton <IStorageInfrastructure>(r => dummyStorageImplementation)
                                  .BuildServiceProvider();

            var messageDispatcherMock = Substitute.For <IServiceMessageDispatcher>();
            var manifests             = new List <IServiceAssemblyManifest> {
                new DummyServiceManifest()
            };

            var sut = new ServiceHost(serviceProvider, NullLogger <ServiceHost> .Instance, messageDispatcherMock, manifests);

            sut.StartServices();

            // Assertions are in DummyService.Start... i know, this doesn't win a design price but i have no better idea at the moment.
        }
コード例 #3
0
        public TestServiceBase()
        {
            var dir = Environment.CurrentDirectory;

            while (!File.Exists(Path.Combine(dir, "appsettings.json")))
            {
                dir = Path.GetDirectoryName(dir);
            }
            Environment.CurrentDirectory = dir;
            JoyOIManagementServiceCollectionExtensions.InitializeStaticFunctions();
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Environment.CurrentDirectory)
                          .AddJsonFile("appsettings.json");
            var configuration = builder.Build();

            _configuration = new JoyOIManagementConfiguration();
            configuration.GetSection("JoyOIManagement").Bind(_configuration);
            _configuration.AfterLoaded();
            _storage = new DummyStorage();
            // 数据库除错代码
            if (false)
            {
#pragma warning disable CS0162
                _storage.OnSaveChanges = (storage) =>
                {
                    var stackTrace = new StackTrace().ToString();
                    var tables     = JsonConvert.SerializeObject(storage.Tables, Formatting.Indented);
                    File.AppendAllText($"e:\\mgmtsvc_dblog_{Process.GetCurrentProcess().Id}.txt",
                                       $"{stackTrace}\r\n{tables}\r\n=====================================================\r\n\r\n");
                };
#pragma warning restore CS0162
            }
        }
コード例 #4
0
 public RenderMockup()
 {
     InitializeComponent();
     this.storage    = new DummyStorage();
     this.connection = new SQLiteConnection(App.databasePath);
     this.storage.BackgroundImage = @"/Assets/trai san dan ong.png";
 }
コード例 #5
0
        internal void DoWithDummyStorageAndAutoConcurrency()
        {
            using (var storage = new DummyStorage())
            {
                var eventsSource    = new EventsSource(_eventsCount);
                var eventsProcessor = new EventsProcessorWithAutoConcurrency(storage);

                MakeExperiment("Dummy storage + auto concurrency", eventsProcessor, eventsSource);
            }
        }
コード例 #6
0
        public static void InitializeAllDataSet()
        {
            DummyStorage.LoadDummyDataSet();

            GlobalUserPositions_Load();

            Members_UpdateStatus();

            //Buddys_Load();

            //Members_RadarInfo();


            IsDummiesLoaded = true;

            string str = "";
        }
コード例 #7
0
 public TestServiceBase()
 {
     JoyOIManagementServiceCollectionExtensions.InitializeStaticFunctions();
     _storage = new DummyStorage();
 }