public void ServiceInvoicesDeleteTest()
        {
            var companyId = "59444568f933f61ea009dad2";

            var invoiceRequest = ServiceInvoiceIssueMessageFactory.GetObj();

            var invoiceResponse = instance.ServiceInvoicesPost(companyId, invoiceRequest);

            string id = invoiceResponse.Id;

            #region Gambiarra maligna pra alterar o status do invoice de created pra issued

            bool flag = false;
            do
            {
                var getResponse = instance.ServiceInvoicesGet_0(companyId, id);
                flag = getResponse.Status.Value.Equals(StatusEnum.Issued);
                Thread.Sleep(500);
            } while (flag == false);

            #endregion

            var jsonResponse = instance.ServiceInvoicesDelete(companyId, id);

            Assert.IsNotNull(jsonResponse);

            var responseObj = JsonConvert.DeserializeObject <ServiceInvoiceResource>(jsonResponse);

            Assert.AreEqual(FlowStatusEnum.WaitingSendCancel, responseObj.FlowStatus.Value);
        }
Ejemplo n.º 2
0
        public void ServiceInvoicesPostTest()
        {
            // TODO uncomment below to test the method and replace null with proper value

            var companyId = "59444568f933f61ea009dad2";

            var fix = new Fixture();

            var myObj = fix.Create <ServiceInvoiceIssueMessage>();

            var response = instance.ServiceInvoicesPost(companyId, myObj);

            Assert.IsInstanceOf <ServiceInvoiceResource>(response, "response is ServiceInvoiceResource");
        }