public void DataStorageProvider_Initialization() { IDataStorage xmlStorage = new XMLDataStorage(); IDataStorageProvider dataStoreProvider = new DataStorageProvider(xmlStorage); Assert.IsNotNull(dataStoreProvider); }
/// <summary> /// Run preparation steps to initialization application /// </summary> /// <param name="eventsProvider"></param> /// <param name="dataStorageProvider"></param> /// <returns></returns> public static SituationalCentre Initialization() { Log.Debug("-------Запуск системы--------"); //1. Init XML DATA Storage IDataStorage storage = new XMLDataStorage(); if (storage.State != ComponentState.Ready) { Log.Error("Initialization(): Cannot init DataStorage."); storage.Dispose(); storage = null; return null; } //. Init Data Provider IDataStorageProvider dataStorageProvider = new DataStorageProvider(storage); if (dataStorageProvider.State != ComponentState.Ready) { Log.Error("Initialization(): Cannot init DataStorageProvider."); storage.Dispose(); storage = null; dataStorageProvider.Dispose(); dataStorageProvider = null; return null; } // return null; //2. create events device bool autoConnect = true; IEventsDevice eventsDevice = new DeviceModemGSM(autoConnect); //3. Init Events provider IEventsProvider eventsProvider = new EventsProvider(eventsDevice); //IDataStorageProvider dataStorageProvider = null; SituationalCentre sCentre = new SituationalCentre(eventsProvider, dataStorageProvider); return sCentre; /// <summary> /// Start up all other components /// </summary> //1. Init XML DATA Storage //IDataStorage storage = new XMLDataStorage(); //2. Init Data provider //3. Init Events provider // //4. SituationalCentre(IEventsProvider eventsProvider, IDataStorageProvider dataStorage) }