예제 #1
0
        public void TestGetDeploysPage()
        {
            using var httpClient = new HttpClient();
            RollbarDeployClient rollbarClient = new RollbarDeployClient(this._loggerConfig, httpClient);

            var task = rollbarClient.GetDeploymentsAsync(RollbarUnitTestSettings.DeploymentsReadAccessToken, 1);

            task.Wait(TimeSpan.FromSeconds(3));
            Assert.IsNotNull(task.Result);
            Assert.AreEqual(0, task.Result.ErrorCode);
            Assert.IsNotNull(task.Result.DeploysPage);
            Assert.IsTrue(task.Result.DeploysPage.PageNumber > 0);
        }
예제 #2
0
        public void TestGetDeploy()
        {
            using var httpClient = new HttpClient();
            RollbarDeployClient rollbarClient = new RollbarDeployClient(this._loggerConfig, httpClient);

            var task = rollbarClient.GetDeploymentAsync(RollbarUnitTestSettings.DeploymentsReadAccessToken, "23838256");

            task.Wait(TimeSpan.FromSeconds(3));
            Assert.IsNotNull(task.Result);
            Assert.AreEqual(0, task.Result.ErrorCode);
            Assert.IsNotNull(task.Result.Deploy);
            Assert.IsTrue(!string.IsNullOrWhiteSpace(task.Result.Deploy.DeployID));
        }
예제 #3
0
        public void TestPostDeployment()
        {
            using var httpClient = new HttpClient();
            RollbarDeployClient rollbarClient = new RollbarDeployClient(this._loggerConfig, httpClient);

            var deployment = DeploymentFactory.CreateDeployment(
                environment: this._loggerConfig.RollbarDestinationOptions.Environment,
                revision: "99909a3a5a3dd4363f414161f340b582bb2e4161",
                comment: "Some new unit test deployment",
                localUserName: "******",
                rollbarUserName: "******",
                writeAccessToken: RollbarUnitTestSettings.DeploymentsWriteAccessToken
                );
            var task = rollbarClient.PostAsync(deployment);

            task.Wait(TimeSpan.FromSeconds(3));
            Assert.IsNull(task.Exception);
        }
        public void TestPostDeployment()
        {
            using (var httpClient = new HttpClient())
            {
                RollbarDeployClient rollbarClient = new RollbarDeployClient(this._loggerConfig, httpClient);

                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);
            }
        }