Exemple #1
0
        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");
        }
Exemple #2
0
        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);
        }
Exemple #3
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);
        }
Exemple #4
0
        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();
        }