public async Task ItCanScrapAnAsset() { var currentDate = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1); var rand = new Random(); var asset = new Asset() { Number = "TestProd" + rand.Next(9999999), Description = "TEST PRODUCT", TypeId = "8", DepreciationMethod = "0", AcquisitionValue = 13000, DepreciateToResidualValue = 1300, AcquisitionDate = currentDate, AcquisitionStart = currentDate.AddMonths(1), DepreciationFinal = currentDate.AddYears(1), }; var request = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret); var result = await AssetsService.CreateAssetAsync(request, asset); Assert.AreEqual(asset.Number, result.Number); var scrapAsset = new AssetScrap { Percentage = 5, Comment = "Scrap comment", Date = currentDate.AddMonths(1) }; var scrappedAsset = await AssetsService.ScrapAssetAsync(request, $"{result.Id}", scrapAsset); await AssetsService.DeleteAssetAsync(request, result.Id.ToString()); }
private async Task DeleteAsset(int assetId) { var request = new FortnoxApiRequest(connectionSettings.AccessToken, connectionSettings.ClientSecret); await AssetsService.DeleteAssetAsync(request, assetId.ToString()); }