コード例 #1
0
ファイル: SIETests.cs プロジェクト: zenta-ab/fortnox.NET
        public void GetSIEYearBalanceForFirstFinnancialYear()
        {
            var request  = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret);
            var response = SIEService.GetSIEAsync(request, SIETypes.YearBalance, 1).GetAwaiter().GetResult();

            Assert.IsTrue(response.Length > 0);
        }
コード例 #2
0
ファイル: SIETests.cs プロジェクト: zenta-ab/fortnox.NET
        public async Task GetSIEAsFileAsync()
        {
            var request  = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret);
            var filePath = Path.GetTempFileName();

            SIEService.GetAndSaveSIEToDiskAsync(request, SIETypes.YearBalance, filePath, 1).GetAwaiter().GetResult();

            Assert.IsTrue(File.Exists(filePath));
            Assert.IsTrue((await File.ReadAllBytesAsync(filePath)).Length > 0);
            File.Delete(filePath);
        }