Exemple #1
0
        public void MapActionSummaryTest()
        {
            // Arrange
            string rawJson = "{\"id\":\"ACT_PJiFWTaNcLW8aVBo2fA8E5Dqd8ZyrH\",\"type\":\"CREATE_TOKEN\",\"time_created\":\"2021-03-24T02:02:27.158Z\",\"resource\":\"ACCESS_TOKENS\",\"resource_request_url\":\"http://*****:*****@globalpay.com\",\"merchant_id\":\"MER_c4c0df11039c48a9b63701adeaa296c3\",\"merchant_name\":\"Sandbox_merchant_2\",\"account_id\":\"\",\"account_name\":\"\",\"source_location\":\"63.241.252.2\",\"destination_location\":\"74.125.196.153\",\"metrics\":{\"X-GP-Version\":\"2020-12-22\"},\"action\":{\"id\":\"ACT_qOTwHG38UvuWwjcI6DBNu0uqbg8eoR\",\"type\":\"ACTION_SINGLE\",\"time_created\":\"2021-04-23T18:23:05.824Z\",\"result_code\":\"SUCCESS\",\"app_id\":\"P3LRVjtGRGxWQQJDE345mSkEh2KfdAyg\",\"app_name\":\"colleens_app\"}}";

            JsonDoc doc = JsonDoc.Parse(rawJson);

            // Act
            ActionSummary action = GpApiMapping.MapActionSummary(doc);

            // Assert
            Assert.AreEqual(doc.GetValue <string>("id"), action.Id);
            Assert.AreEqual(doc.GetValue <string>("type"), action.Type);
            Assert.AreEqual(doc.GetValue <DateTime>("time_created"), action.TimeCreated);
            Assert.AreEqual(doc.GetValue <string>("resource"), action.Resource);
            Assert.AreEqual(doc.GetValue <string>("version"), action.Version);
            Assert.AreEqual(doc.GetValue <string>("resource_id"), action.ResourceId);
            Assert.AreEqual(doc.GetValue <string>("resource_status"), action.ResourceStatus);
            Assert.AreEqual(doc.GetValue <string>("http_response_code"), action.HttpResponseCode);
            Assert.AreEqual(doc.GetValue <string>("response_code"), action.ResponseCode);
            Assert.AreEqual(doc.GetValue <string>("app_id"), action.AppId);
            Assert.AreEqual(doc.GetValue <string>("app_name"), action.AppName);
            Assert.AreEqual(doc.GetValue <string>("account_id"), action.AccountId);
            Assert.AreEqual(doc.GetValue <string>("account_name"), action.AccountName);
            Assert.AreEqual(doc.GetValue <string>("merchant_name"), action.MerchantName);
        }
Exemple #2
0
        public void ReportActionDetail()
        {
            string        actionId = SampleAction.Id;
            ActionSummary response = ReportingService.ActionDetail(actionId)
                                     .Execute();

            Assert.IsNotNull(response);
            Assert.IsTrue(response is ActionSummary);
            Assert.AreEqual(actionId, response.Id);
        }
Exemple #3
0
        public static void ClassInitialize(TestContext context)
        {
            ServicesContainer.ConfigureService(new GpApiConfig {
                AppId  = "P3LRVjtGRGxWQQJDE345mSkEh2KfdAyg",
                AppKey = "ockJr6pv6KFoGiZA",
            });

            SampleAction = ReportingService.FindActionsPaged(1, 1)
                           .Where(SearchCriteria.StartDate, DateTime.UtcNow.AddDays(-5))
                           .Execute().Results?.FirstOrDefault();
        }
        public static void ClassInitialize(TestContext context)
        {
            ServicesContainer.ConfigureService(new GpApiConfig {
                AppId         = APP_ID,
                AppKey        = APP_KEY,
                RequestLogger = new RequestConsoleLogger(),
            });

            SampleAction = ReportingService.FindActionsPaged(1, 1)
                           .Where(SearchCriteria.StartDate, DateTime.UtcNow.AddDays(-5))
                           .Execute().Results?.FirstOrDefault();
        }