Ejemplo n.º 1
0
        /// <summary>
        /// Registers the deployment asynchronously.
        /// </summary>
        /// <param name="deployment">The deployment.</param>
        /// <returns></returns>
        public async Task RegisterAsync(IDeployment deployment)
        {
            Assumption.AssertNotNullOrWhiteSpace(this._writeAccessToken, nameof(this._writeAccessToken));

            var config =
                new RollbarConfig(this._writeAccessToken)
            {
                Environment = deployment.Environment,
            };

            RollbarClient rollbarClient = new RollbarClient(config);

            await rollbarClient.PostAsync(deployment);
        }
Ejemplo n.º 2
0
        public void TestPostDeployment()
        {
            RollbarClient rollbarClient = new RollbarClient(this._loggerConfig);

            var deployment = new Deployment(this._loggerConfig.AccessToken, this._loggerConfig.Environment, "99909a3a5a3dd4363f414161f340b582bb2e4161")
            {
                Comment         = "Some new unit test deployment",
                LocalUsername   = "******",
                RollbarUsername = "******",
            };

            var task = rollbarClient.PostAsync(deployment);

            task.Wait(TimeSpan.FromSeconds(3));
            Assert.IsNull(task.Exception);
        }