Example #1
0
        public void ItShouldDownloadTransactionReportFile()
        {
            // Cria o client que enviará a transação
            TransactionReportClient transactionReportClient = new TransactionReportClient(MerchantKey, _hostUri);

            // Faz o download para a variável
            HttpResponse httpResponse = transactionReportClient.DownloadReport(new DateTime(2015, 9, 19));

            Assert.AreEqual(HttpStatusCode.OK, httpResponse.HttpStatusCode);
        }
Example #2
0
        public void ItShouldParseTransactionReportFile()
        {
            // Cria o client que enviará a transação
            TransactionReportClient transactionReportClient = new TransactionReportClient(MerchantKey, _hostUri);

            // Faz o download para a variável
            HttpResponse httpResponse = transactionReportClient.DownloadReport(new DateTime(2015, 9, 19));

            Assert.AreEqual(HttpStatusCode.OK, httpResponse.HttpStatusCode);

            TransactionReportParser transactionReportParser = new TransactionReportParser();

            TransactionReport response = transactionReportParser.ParseString(httpResponse.RawResponse);

            Assert.AreEqual(response.Header.ReportFileCreateDate, new DateTime(2015, 9, 20));
        }