Beispiel #1
0
 ///<summary>
 ///</summary>
 public HgResumeTransport(HgRepository repo, string targetLabel, IApiServer apiServer, IProgress progress)
 {
     _repo        = repo;
     _targetLabel = targetLabel;
     _apiServer   = apiServer;
     _progress    = progress;
 }
Beispiel #2
0
 ///<summary>
 ///</summary>
 public HgResumeTransport(HgRepository repo, string targetLabel, IApiServer apiServer, IProgress progress)
 {
     _repo = repo;
     _targetLabel = targetLabel;
     _apiServer = apiServer;
     _progress = progress;
 }
Beispiel #3
0
        private static void ServerCall(IApiServer _server)
        {
            _Log.Info("Bootsrapping application..");

            _Log.Info("WithCqs..");

            // init command and query results
            Result <SaveBookCommandResult, SaveBookCommandError> cmdResult;
            Result <GetBooksQueryResult, GetBooksQueryError>     queryResult;

            //add new book
            cmdResult = _server.SaveBook(new SaveBookCommand("C# in Depth#1", false));
            PrintCommand("Add 1 book", cmdResult);
            cmdResult = _server.SaveBook(new SaveBookCommand("C# in Depth#2", true));
            PrintCommand("Add 1 book", cmdResult);

            // read all books + print them
            queryResult = _server.GetBooks(new GetBooksQuery(false));
            PrintQuery("All books query", queryResult);

            //add another book
            cmdResult = _server.SaveBook(new SaveBookCommand("C# in Depth#3", true));
            PrintCommand("Add 1 book", cmdResult);

            // read filtered books + print them
            queryResult = _server.GetBooks(new GetBooksQuery(true));
            PrintQuery("Filtered books query", queryResult);

            System.Console.ReadLine();
        }
Beispiel #4
0
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            Logger.Info("Starting service");

            _containerProvider = new UnityContainerProvider();

            LoadPlugins(_containerProvider);

            _apiServer     = _containerProvider.Resolve <IApiServer>();
            _apiClient     = _containerProvider.Resolve <IApiClient>();
            _engine        = _containerProvider.Resolve <IAudioEngine>();
            _updateService = _containerProvider.Resolve <IUpdateService>();

            await _apiServer.StartAsync();

            _settingsService = _containerProvider.Resolve <ISettingsService>();
            await _settingsService.LoadAsync().ConfigureAwait(false);

            if (_settingsService.GetSetting <bool>(Globals.SettingKeys.IsEngineRunning))
            {
                _engine.Start();
            }

            _updateTimer.Start();

            Logger.Info("Service started");
        }
Beispiel #5
0
        public void SetUpTestEnvironment()
        {
            ConfigureBddfy();
            _server = new InMemoryApiServer();
            var container = BuildContainer();

            ContainerRegistry.Register(container);
            _server.Start();
        }
Beispiel #6
0
        public ServerModel(IServer server, IApiServer apiServer)
        {
            Server    = server;
            Name      = server.ServerType.ToString();
            ApiServer = apiServer;

            server.ConnectStatusChangeEvent += ServerOnConnectStatusChangeEvent;
            server.LogMessageEvent          += ServerOnLogMessageEvent;
        }
Beispiel #7
0
        /// <summary>添加服务器</summary>
        /// <param name="uri"></param>
        public IApiServer Use(NetUri uri)
        {
            var svr = new ApiNetServer();

            if (!svr.Init(uri.ToString()))
            {
                return(null);
            }

            Server = svr;

            return(svr);
        }
 protected RemoveBooksApiTests(IApiServer apiServer)
 {
     _server = apiServer;
 }
 protected CreateBooksApiTests(IApiServer apiServer)
 {
     _server = apiServer;
 }
Beispiel #10
0
 protected BookApiTests(IApiServer apiServer)
 {
     _server = apiServer;
 }
Beispiel #11
0
 protected CreateBooksApiTests(IApiServer apiServer)
 {
     _server = apiServer;
 }
 protected RemoveBooksApiTests(IApiServer apiServer)
 {
     _server = apiServer;
 }
Beispiel #13
0
 public ValueTests(IApiServer server)
 {
     _server = server;
 }
 public WebApiApplicationDriver()
 {
     _server = new InMemoryApiServer();
 }
 public WebApiApplicationDriver(IApiServer server)
 {
     _server = server;
 }
Beispiel #16
0
 protected BookApiTests(IApiServer apiServer)
 {
     _server = apiServer;
 }