public void GetWayOfDeliveryTest() { var request = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret); var response = WayOfDeliveryService.GetWayOfDeliveryAsync(request, "P").GetAwaiter().GetResult(); Assert.IsTrue(response.Description == "Post"); }
public async Task GetWayOfDeliveriesTest() { var request = new WayOfDeliveryListRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret); var response = await WayOfDeliveryService.GetWayOfDeliveriesAsync(request); Assert.IsTrue(response.Data.Count() > 0); }
public void UpdateSupplierInvoicePaymentTest() { var desc = $"{DateTime.Now}"; var request = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret); var wayOfDelivery = new WayOfDelivery { Code = "TEST", Description = desc }; var updatedWayOfDelivery = WayOfDeliveryService.UpdateWayOfDeliveryAsync(request, wayOfDelivery).GetAwaiter().GetResult(); Assert.AreEqual(desc, updatedWayOfDelivery.Description); }
public void DeleteWayOfDeliveryTest() { //TODO: Avoid cluttering Fortnox with data var request = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret); var response = WayOfDeliveryService.CreateWayOfDeliveryAsync(request, new WayOfDelivery { Code = "DEL", Description = "Will Be deleted" }).GetAwaiter().GetResult(); Assert.AreEqual("DEL", response.Code); WayOfDeliveryService.DeleteWayOfDeliveryAsync(request, response.Code).GetAwaiter().GetResult(); }