Ejemplo n.º 1
0
 public void Init()
 {
     applicationReleaseConfiguration = Substitute.For <IApplicationReleaseConfiguration>();
     applicationReleaseConfiguration.GetString("BRANCH").Returns("master");
     applicationReleaseConfiguration.GetString("COMMIT").Returns("da5d17");
     applicationReleaseConfiguration.GetInt("BUILD_VERSION").Returns(12345);
 }
Ejemplo n.º 2
0
        public MapDataDownloadService(IApplicationReleaseConfiguration configuration, IHttpClientFactory httpClientFactory)
        {
            var server = configuration.GetString("MAPDATA_SERVER");

            hasMapServer      = server != null;
            this.mapServerUrl = new Uri(server ?? "http://localhost");
            this.client       = httpClientFactory.Factory();
        }
        private void Setup(string?server, string?key, string?marketplace, string?platform)
        {
            config = Substitute.For <IApplicationReleaseConfiguration>();

            config.GetString("UPDATE_SERVER").Returns(server);
            config.GetString("UPDATE_KEY").Returns(key);
            config.GetString("MARKETPLACE").Returns(marketplace);
            config.GetString("PLATFORM").Returns(platform);
        }
Ejemplo n.º 4
0
        public ApplicationVersion(IApplicationReleaseConfiguration appData)
        {
            var branch  = appData.GetString("BRANCH");
            var commit  = appData.GetString("COMMIT");
            var version = appData.GetInt("BUILD_VERSION");

            VersionKnown = branch != null && commit != null && version != null;
            Branch       = branch ?? "<no build data>";
            CommitHash   = commit ?? "<no build data>";
            BuildVersion = version ?? 0;
        }
Ejemplo n.º 5
0
        public UpdateServerDataProvider(IApplicationReleaseConfiguration configuration)
        {
            var       updateServer   = configuration.GetString("UPDATE_SERVER");
            var       updateKey      = configuration.GetString("UPDATE_KEY");
            var       marketplace    = configuration.GetString("MARKETPLACE");
            var       platformString = configuration.GetString("PLATFORM");
            Platforms?platform       = null;

            if (platformString != null && Enum.TryParse(platformString, true, out Platforms p))
            {
                platform = p;
            }

            HasUpdateServerData = updateServer != null && marketplace != null && platform != null;
            UpdateServerUrl     = SafeCreateUrl(updateServer, new Uri("http://localhost"));
            Marketplace         = marketplace ?? "";
            UpdateKey           = updateKey;
            Platform            = platform ?? Platforms.Windows;
        }
Ejemplo n.º 6
0
 public CommentPublisherService(IHttpClientFactory httpClientFactory, IApplicationReleaseConfiguration configuration)
 {
     updateServer           = configuration.GetString("UPDATE_SERVER") ?? "http://localhost";
     this.httpClientFactory = httpClientFactory;
 }