Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update port field to int #130

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public void Host_SetsAndGetsValue_WithDifferentInputs(string host)
}

[Theory]
[InlineData("1234")]
[InlineData(3306)]
[InlineData(null)]
public void Port_SetsAndGetsValue_WithDifferentInputs(string port)
public void Port_SetsAndGetsValue_WithDifferentInputs(int port)
{
// Arrange
var dataSource = new MicrosoftSqlServerDataSource();
Expand Down
4 changes: 2 additions & 2 deletions src/Reveal.Sdk.Dom.Tests/Data/HostDataSourceFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public void GetPort_ReturnSameValue_WithSetPort()
{
// Arrange
var hostDataSource = new HostDataSource();
var expectedPort = "8080";
var expectedPort = 8080;

// Act
hostDataSource.Port = expectedPort;

// Assert
Assert.Equal(expectedPort, hostDataSource.Port);
Assert.Equal(expectedPort, hostDataSource.Properties.GetValue<string>("Port"));
Assert.Equal(expectedPort, hostDataSource.Properties.GetValue<int>("Port"));
}
}
}
4 changes: 2 additions & 2 deletions src/Reveal.Sdk.Dom/Data/HostDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public string Host
}

[JsonIgnore]
public string Port
public int Port
{
get => Properties.GetValue<string>("Port");
get => Properties.GetValue<int>("Port");
set => Properties.SetItem("Port", value);
}
}
Expand Down
Loading