From bde7850469e4d8d1a79dd5664ca15112a0ca0824 Mon Sep 17 00:00:00 2001 From: adamelfstrom <105274564+adamelfstrom@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:12:53 +0100 Subject: [PATCH] Update tests --- FortnoxSDK.Tests/ConnectorTests/AbsenceTransactionTests.cs | 6 +++--- FortnoxSDK.Tests/ConnectorTests/AssetTests.cs | 4 ++-- .../ConnectorTests/AttendanceTransactionsTests.cs | 6 +++--- FortnoxSDK.Tests/ConnectorTests/ContractAccrualTests.cs | 2 +- FortnoxSDK.Tests/ConnectorTests/ContractTemplateTests.cs | 1 - FortnoxSDK.Tests/ConnectorTests/ContractTests.cs | 2 +- FortnoxSDK.Tests/ConnectorTests/InvoiceTests.cs | 2 ++ FortnoxSDK.Tests/ConnectorTests/PrintTemplateTests.cs | 4 ++-- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/FortnoxSDK.Tests/ConnectorTests/AbsenceTransactionTests.cs b/FortnoxSDK.Tests/ConnectorTests/AbsenceTransactionTests.cs index d592ecba..75c1cdb2 100644 --- a/FortnoxSDK.Tests/ConnectorTests/AbsenceTransactionTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/AbsenceTransactionTests.cs @@ -13,14 +13,14 @@ namespace FortnoxSDK.Tests.ConnectorTests; public class AbsenceTransactionTests { public FortnoxClient FortnoxClient = TestUtils.DefaultFortnoxClient; - + [TestMethod] public async Task Test_AbsenceTransaction_CRUD() { #region Arrange var tmpEmployee = await TestUtils.GetBasicTestEmployee(); var tmpProject = await FortnoxClient.ProjectConnector.CreateAsync(new Project() { Description = "TmpProject" }); - var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TEMP", Description = "TempCostCenter" }); + var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TMPCC", Description = "TempCostCenter" }); #endregion Arrange var connector = FortnoxClient.AbsenceTransactionConnector; @@ -80,7 +80,7 @@ public async Task Test_Find() #region Arrange var tmpEmployee = await TestUtils.GetBasicTestEmployee(); var tmpProject = await FortnoxClient.ProjectConnector.CreateAsync(new Project() { Description = "TmpProject" }); - var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TEMP", Description = "TempCostCenter" }); + var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TMPCC", Description = "TempCostCenter" }); #endregion Arrange var connector = FortnoxClient.AbsenceTransactionConnector; diff --git a/FortnoxSDK.Tests/ConnectorTests/AssetTests.cs b/FortnoxSDK.Tests/ConnectorTests/AssetTests.cs index f065dd1c..50cfe9f9 100644 --- a/FortnoxSDK.Tests/ConnectorTests/AssetTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/AssetTests.cs @@ -17,7 +17,7 @@ public class AssetTests public async Task Test_Asset_CRUD() { #region Arrange - var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TEMP", Description = "TempCostCenter" }); + var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TMPCC", Description = "TempCostCenter" }); var tmpAssetType = await FortnoxClient.AssetTypesConnector.CreateAsync(new AssetType() { Description = "TmpAssetType", Type = "1", Number = TestUtils.RandomString(3), AccountAssetId = 1150, AccountDepreciationId = 7824, AccountValueLossId = 1159 }); #endregion Arrange @@ -82,7 +82,7 @@ await Assert.ThrowsExceptionAsync( public async Task Test_Find() { #region Arrange - var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TEMP", Description = "TempCostCenter" }); + var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TMPCC", Description = "TempCostCenter" }); var tmpAssetType = await FortnoxClient.AssetTypesConnector.CreateAsync(new AssetType() { Description = "TmpAssetType", Type = "1", Number = TestUtils.RandomString(3), AccountAssetId = 1150, AccountDepreciationId = 7824, AccountValueLossId = 1159 }); #endregion Arrange diff --git a/FortnoxSDK.Tests/ConnectorTests/AttendanceTransactionsTests.cs b/FortnoxSDK.Tests/ConnectorTests/AttendanceTransactionsTests.cs index 2280cf0c..2fffec83 100644 --- a/FortnoxSDK.Tests/ConnectorTests/AttendanceTransactionsTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/AttendanceTransactionsTests.cs @@ -20,7 +20,7 @@ public async Task Test_AttendanceTransactions_CRUD() #region Arrange var tmpEmployee = await TestUtils.GetBasicTestEmployee(); var tmpProject = await FortnoxClient.ProjectConnector.CreateAsync(new Project() { Description = "TmpProject" }); - var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TEMP", Description = "TempCostCenter" }); + var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TMPCC", Description = "TempCostCenter" }); #endregion Arrange var connector = FortnoxClient.AttendanceTransactionsConnector; @@ -40,7 +40,7 @@ public async Task Test_AttendanceTransactions_CRUD() Assert.AreEqual(5.5m, createdAttendanceTransaction.Hours); #endregion CREATE - + #region UPDATE createdAttendanceTransaction.Hours = 8; @@ -80,7 +80,7 @@ public async Task Test_Find() #region Arrange var tmpEmployee = await TestUtils.GetBasicTestEmployee(); var tmpProject = await FortnoxClient.ProjectConnector.CreateAsync(new Project() { Description = "TmpProject" }); - var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TEMP", Description = "TempCostCenter" }); + var tmpCostCenter = await FortnoxClient.CostCenterConnector.CreateAsync(new CostCenter() { Code = "TMPCC", Description = "TempCostCenter" }); #endregion Arrange var connector = FortnoxClient.AttendanceTransactionsConnector; diff --git a/FortnoxSDK.Tests/ConnectorTests/ContractAccrualTests.cs b/FortnoxSDK.Tests/ConnectorTests/ContractAccrualTests.cs index e57b759b..a60cc7b6 100644 --- a/FortnoxSDK.Tests/ConnectorTests/ContractAccrualTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/ContractAccrualTests.cs @@ -9,7 +9,7 @@ namespace FortnoxSDK.Tests.ConnectorTests; -[Ignore("Fails with error 'Feature inte tillgänglig'")] +[Ignore("Fails with error 'Feature inte tillgänglig'")] [TestClass] public class ContractAccrualTests { diff --git a/FortnoxSDK.Tests/ConnectorTests/ContractTemplateTests.cs b/FortnoxSDK.Tests/ConnectorTests/ContractTemplateTests.cs index b4c4a73d..ca6bbe4f 100644 --- a/FortnoxSDK.Tests/ConnectorTests/ContractTemplateTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/ContractTemplateTests.cs @@ -13,7 +13,6 @@ public class ContractTemplateTests { public FortnoxClient FortnoxClient = TestUtils.DefaultFortnoxClient; - [Ignore("Failing on 'Internal error'. Investigation needed")] [TestMethod] public async Task Test_ContractTemplate_CRUD() { diff --git a/FortnoxSDK.Tests/ConnectorTests/ContractTests.cs b/FortnoxSDK.Tests/ConnectorTests/ContractTests.cs index 7bacab46..90bcf896 100644 --- a/FortnoxSDK.Tests/ConnectorTests/ContractTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/ContractTests.cs @@ -9,7 +9,7 @@ namespace FortnoxSDK.Tests.ConnectorTests; -[Ignore("Failing on 'Internal error'. Investigation needed")] +[Ignore("Fails with error 'Feature inte tillgänglig'")] [TestClass] public class ContractTests { diff --git a/FortnoxSDK.Tests/ConnectorTests/InvoiceTests.cs b/FortnoxSDK.Tests/ConnectorTests/InvoiceTests.cs index 3d97e6cd..97bb9178 100644 --- a/FortnoxSDK.Tests/ConnectorTests/InvoiceTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/InvoiceTests.cs @@ -227,6 +227,7 @@ public async Task Test_EPrint() #endregion Delete arranged resources } + [Ignore("Fails with 'Bankuppgifter saknas'")] [TestMethod] public async Task Test_Print() { @@ -268,6 +269,7 @@ public async Task Test_Print() #endregion Delete arranged resources } + [Ignore("Fails with 'Bankuppgifter saknas'")] [TestMethod] public async Task Test_Email() { diff --git a/FortnoxSDK.Tests/ConnectorTests/PrintTemplateTests.cs b/FortnoxSDK.Tests/ConnectorTests/PrintTemplateTests.cs index f1223e5b..99594121 100644 --- a/FortnoxSDK.Tests/ConnectorTests/PrintTemplateTests.cs +++ b/FortnoxSDK.Tests/ConnectorTests/PrintTemplateTests.cs @@ -24,7 +24,7 @@ public async Task Test_Find() var fullCollection = await connector.FindAsync(null); - Assert.AreEqual(9, fullCollection.Entities.Count); + Assert.AreEqual(8, fullCollection.Entities.Count); Assert.IsNotNull(fullCollection.Entities.First().Name); //Limit not supported @@ -49,6 +49,6 @@ public async Task Test_Find_Filter() searchSettings.FilterBy = Filter.PrintTemplate.Invoice; var invoiceTemplates = await connector.FindAsync(searchSettings); - Assert.AreEqual(9, invoiceTemplates.Entities.Count); + Assert.AreEqual(8, invoiceTemplates.Entities.Count); } } \ No newline at end of file