Skip to content

Commit

Permalink
fix UTs of RestDataSource
Browse files Browse the repository at this point in the history
  • Loading branch information
recca5p committed Dec 11, 2024
1 parent 61256a2 commit ef4e538
Showing 1 changed file with 40 additions and 31 deletions.
71 changes: 40 additions & 31 deletions src/Reveal.Sdk.Dom.Tests/Data/DataSources/RestDataSourceFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,18 @@ public void RDashDocument_HasCorrectDataSource_WhenLoadFromFile()
public void ToJsonString_CreatesFormattedJson_ForRestDataSource()
{
// Arrange
var expectedJson = @"
{
""_type"": ""DataSourceType"",
""Id"": ""Rest"",
""Provider"": ""REST"",
""Description"": ""Rest DS"",
""Subtitle"": ""Excel2Json"",
""Properties"": {}
}";
var expectedJson =
"""
{
"_type": "DataSourceType",
"Id": "7473e6b8-ba86-4703-8e69-79f83d0742f3",
"Provider": "REST",
"Description": "JSON DS",
"Subtitle": "JSON DS Subtitle",
"Properties": {},
"Settings": {}
}
""";

var dataSourceItems = new RestDataSourceItem("DB Test", new DataSource { Title = "JSON DS", Subtitle = "JSON DS Subtitle" })
{
Expand Down Expand Up @@ -170,17 +173,20 @@ public void ToJsonString_CreatesFormattedJson_ForRestDataSource()
public void ToJsonString_CreatesFormattedUseCsv_ForRestDataSource()
{
// Arrange
var expectedJson = @"
{
""_type"": ""DataSourceType"",
""Id"": ""ecca74a8-2082-4630-ae2b-e59e095bb87f"",
""Provider"": ""REST"",
""Description"": ""JSON DS"",
""Subtitle"": ""JSON DS Subtitle"",
""Properties"": {
""Result-Type"": "".csv""
}
}";
var expectedJson =
"""
{
"_type": "DataSourceType",
"Id": "717a8e83-15c5-403b-b621-e7f103f7a2ad",
"Provider": "REST",
"Description": "JSON DS",
"Subtitle": "JSON DS Subtitle",
"Properties": {
"Result-Type": ".csv"
},
"Settings": {}
}
""";

var dataSourceItems = new RestDataSourceItem("DB Test", new DataSource { Title = "JSON DS", Subtitle = "JSON DS Subtitle" })
{
Expand Down Expand Up @@ -213,17 +219,20 @@ public void ToJsonString_CreatesFormattedUseCsv_ForRestDataSource()
public void ToJsonString_CreatesFormattedUseExcel_ForRestDataSource()
{
// Arrange
var expectedJson = @"
{
""_type"": ""DataSourceType"",
""Id"": ""2ed39a3b-f267-434f-a3ca-319801c1b7b5"",
""Provider"": ""REST"",
""Description"": ""JSON DS"",
""Subtitle"": ""JSON DS Subtitle"",
""Properties"": {
""Result-Type"": "".xlsx""
}
}";
var expectedJson =
"""
{
"_type": "DataSourceType",
"Id": "20e1b99f-ddab-40dd-afd2-4b8b1fcf9917",
"Provider": "REST",
"Description": "JSON DS",
"Subtitle": "JSON DS Subtitle",
"Properties": {
"Result-Type": ".xlsx"
},
"Settings": {}
}
""";

var dataSourceItems = new RestDataSourceItem("DB Test", new DataSource { Title = "JSON DS", Subtitle = "JSON DS Subtitle" })
{
Expand Down

0 comments on commit ef4e538

Please sign in to comment.