Skip to content

Commit

Permalink
Fix failed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vulh-infragistics committed Dec 11, 2024
1 parent 9dd9923 commit 8b92aff
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,22 @@ public void GetProcessDataOnServer_ReturnSameValue_AfterSet()
public void ToJsonString_CreatesFormattedJson_NoConditions()
{
// Arrange
var expectedJson = @"{
""_type"": ""DataSourceItemType"",
""Id"": ""a60ab508-0ed4-46e4-8d90-c3a9c09c29b8"",
""Title"": ""SnowFlake DSI"",
""DataSourceId"": ""snowflake_ds"",
""HasTabularData"": true,
""HasAsset"": false,
""Properties"": {
""ServerAggregation"": true,
""Table"": ""CALL_CENTER"",
""Schema"": ""TPCDS_SF100TCL""
var expectedJson = """
{
"_type": "DataSourceItemType",
"Id": "a60ab508-0ed4-46e4-8d90-c3a9c09c29b8",
"Title": "SnowFlake DSI",
"DataSourceId": "snowflake_ds",
"HasTabularData": true,
"HasAsset": false,
"Properties": {
"ServerAggregation": true,
"Table": "CALL_CENTER",
"Schema": "TPCDS_SF100TCL"
},
""Parameters"": {}
}";

"Parameters": {}
}
""";
var dataSource = new SnowflakeDataSource()
{
Id = "snowflake_ds",
Expand All @@ -97,7 +98,6 @@ public void ToJsonString_CreatesFormattedJson_NoConditions()
Table = "CALL_CENTER",
Schema = "TPCDS_SF100TCL",
};

var expectedJObject = JObject.Parse(expectedJson);

// Act
Expand All @@ -106,7 +106,6 @@ public void ToJsonString_CreatesFormattedJson_NoConditions()

// Assert
Assert.Equal(expectedJObject, actualJObject);

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,27 @@ public void SetWarehouse_ReturnSameValue_AfterSetWarehouse(string warehouse)
public void ToJsonString_CreatesFormattedJson_NoConditions()
{
// Arrange
var expectedJson = @"{
""_type"": ""DataSourceType"",
""Id"": ""snowflake_ds"",
""Provider"": ""SNOWFLAKE"",
""Description"": ""Snowflake TEST"",
""Subtitle"": ""Snowflake TEST Subtitle"",
""Properties"": {
""ServerAggregationDefault"": true,
""ServerAggregationReadOnly"": false,
""Host"": ""gpiskyj-al16914.snowflakecomputing.com"",
""Database"": ""SNOWFLAKE_SAMPLE_DATA"",
""Account"": ""pqwkobs-xb90908"",
""Warehouse"": ""COMPUTE_WH"",
""Schema"": ""TPCDS_SF100TCL""
var expectedJson = """
{
"_type": "DataSourceType",
"Id": "snowflake_ds",
"Provider": "SNOWFLAKE",
"Description": "Snowflake TEST",
"Subtitle": "Snowflake TEST Subtitle",
"Properties": {
"ServerAggregationDefault": true,
"ServerAggregationReadOnly": false,
"Host": "gpiskyj-al16914.snowflakecomputing.com",
"Database": "SNOWFLAKE_SAMPLE_DATA",
"Account": "pqwkobs-xb90908",
"Warehouse": "COMPUTE_WH",
"Schema": "TPCDS_SF100TCL"
},
//""Settings"": {} // TODO: Update to check settings fields after Postgresql PR is merged
}";

"Settings": {
"DefaultRefreshRate": 180
}
}
""";
var dataSource = new SnowflakeDataSource()
{
Id = "snowflake_ds",
Expand All @@ -99,6 +102,7 @@ public void ToJsonString_CreatesFormattedJson_NoConditions()
Account = "pqwkobs-xb90908",
Warehouse = "COMPUTE_WH",
Schema = "TPCDS_SF100TCL",
DefaultRefreshRate = "180"
};
var expectedJObject = JObject.Parse(expectedJson);

Expand All @@ -108,7 +112,6 @@ public void ToJsonString_CreatesFormattedJson_NoConditions()

// Assert
Assert.Equal(expectedJObject, actualJObject);

}
}
}

0 comments on commit 8b92aff

Please sign in to comment.