From 12b0452df21da1a73445b5704dfe73c8094c31e7 Mon Sep 17 00:00:00 2001 From: Viktor Date: Wed, 11 Dec 2024 14:11:52 +0700 Subject: [PATCH] Fix failed unit tests --- ...softAzureSqlServerDataSourceItemFixture.cs | 3 +- ...icrosoftAzureSqlServerDataSourceFixture.cs | 43 ++++++++++--------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/MicrosoftAzureSqlServerDataSourceItemFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/MicrosoftAzureSqlServerDataSourceItemFixture.cs index 555717ae..abcfdd08 100644 --- a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/MicrosoftAzureSqlServerDataSourceItemFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/MicrosoftAzureSqlServerDataSourceItemFixture.cs @@ -92,8 +92,7 @@ public void ToJsonString_CreateExpectedRevealJson_NoConditions() HasAsset = false, ProcessDataOnServer = true, Database = "reveal", - Table = "Categories" - //DefaultRefreshRate = "161" // TODO: Check the DefaultRefreshRate when get Json, after DefaultRefreshRate is moved to Settings field + Table = "Categories", }; // Act diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/MicrosoftAzureSqlServerDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/MicrosoftAzureSqlServerDataSourceFixture.cs index 16911a15..dd912ec6 100644 --- a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/MicrosoftAzureSqlServerDataSourceFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/MicrosoftAzureSqlServerDataSourceFixture.cs @@ -36,24 +36,28 @@ public void GetTrustServerCertificate_ReturnSameValue_WhenSet() public void ToJsonString_CreateExpectedRevealJson_NoConditions() { // Arrange - var expectedJson = @"{ - ""_type"": ""DataSourceType"", - ""Id"": ""azureSqlId"", - ""Provider"": ""AZURE_SQL"", - ""Description"": ""Azure SQL DS"", - ""Subtitle"": ""Azure SQL DS Item"", - ""Properties"": { - ""ServerAggregationDefault"": false, - ""ServerAggregationReadOnly"": true, - ""Host"": ""revealtesting.database.windows.net"", - ""Port"": 1433, - ""Database"": ""reveal"", - ""Schema"": ""azureSchema"", - ""TrustServerCertificate"": false, - ""Encrypt"": false + var expectedJson = """ + { + "_type": "DataSourceType", + "Id": "azureSqlId", + "Provider": "AZURE_SQL", + "Description": "Azure SQL DS", + "Subtitle": "Azure SQL DS Item", + "Properties": { + "ServerAggregationDefault": false, + "ServerAggregationReadOnly": true, + "Host": "revealtesting.database.windows.net", + "Port": 1433, + "Database": "reveal", + "Schema": "azureSchema", + "TrustServerCertificate": false, + "Encrypt": false }, - - }"; + "Settings": { + "DefaultRefreshRate": 180 + } + } + """; var dataSource = new MicrosoftAzureSqlServerDataSource() { Id = "azureSqlId", @@ -67,7 +71,7 @@ public void ToJsonString_CreateExpectedRevealJson_NoConditions() Schema = "azureSchema", TrustServerCertificate = false, Encrypt = false, - //DefaultRefreshRate = "161" // TODO: Check the DefaultRefreshRate when get Json, after DefaultRefreshRate is moved to Settings field + DefaultRefreshRate = "180" }; // Act @@ -79,5 +83,4 @@ public void ToJsonString_CreateExpectedRevealJson_NoConditions() Assert.Equal(expectedJObject, actualJObject); } } -} - \ No newline at end of file +}