From 3a4dfddc7b8494dc9699d0c2c8259c8a6e163113 Mon Sep 17 00:00:00 2001 From: Viktor Date: Fri, 15 Nov 2024 16:54:10 +0700 Subject: [PATCH 1/3] Add unit tests for Host Data Source --- .../Data/DataSources/HostDataSourceFixture.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs new file mode 100644 index 0000000..0894067 --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs @@ -0,0 +1,37 @@ +using Reveal.Sdk.Dom.Data; +using System; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSources +{ + public class HostDataSourceFixture + { + [Fact] + public void GetHost_ReturnSameValue_WithSetValue() + { + // Arrange + var hostDataSource = new HostDataSource(); + var expectedHost = "test-host"; + + // Act + hostDataSource.Host = expectedHost; + + // Assert + Assert.Equal(expectedHost, hostDataSource.Host); + } + + [Fact] + public void GetPort_ReturnSameValue_WithSetPort() + { + // Arrange + var hostDataSource = new HostDataSource(); + var expectedPort = "port"; + + // Act + hostDataSource.Port = expectedPort; + + // Assert + Assert.Equal(expectedPort, hostDataSource.Port); + } + } +} From 7ccebc3aa071fb689f86b9ace51ee27a295d4f8f Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 18 Nov 2024 09:01:41 +0700 Subject: [PATCH 2/3] Update DS Host unit tests --- .../Data/DataSources/HostDataSourceFixture.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs index 0894067..316b22e 100644 --- a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs @@ -1,4 +1,5 @@ -using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; using System; using Xunit; @@ -18,6 +19,7 @@ public void GetHost_ReturnSameValue_WithSetValue() // Assert Assert.Equal(expectedHost, hostDataSource.Host); + Assert.Equal(expectedHost, hostDataSource.Properties.GetValue("Host")); } [Fact] @@ -25,13 +27,14 @@ public void GetPort_ReturnSameValue_WithSetPort() { // Arrange var hostDataSource = new HostDataSource(); - var expectedPort = "port"; + var expectedPort = "8080"; // Act hostDataSource.Port = expectedPort; // Assert Assert.Equal(expectedPort, hostDataSource.Port); + Assert.Equal(expectedPort, hostDataSource.Properties.GetValue("Port")); } } } From d1dbd6686cdf5d5726e6fc9e926d598dc0ffa00b Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 19 Nov 2024 16:04:23 +0700 Subject: [PATCH 3/3] Update Host data source (item) fixture places --- .../Data/{DataSources => }/HostDataSourceFixture.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename src/Reveal.Sdk.Dom.Tests/Data/{DataSources => }/HostDataSourceFixture.cs (90%) diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/HostDataSourceFixture.cs similarity index 90% rename from src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs rename to src/Reveal.Sdk.Dom.Tests/Data/HostDataSourceFixture.cs index 316b22e..fbfae16 100644 --- a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/HostDataSourceFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Data/HostDataSourceFixture.cs @@ -3,7 +3,7 @@ using System; using Xunit; -namespace Reveal.Sdk.Dom.Tests.Data.DataSources +namespace Reveal.Sdk.Dom.Tests.Data { public class HostDataSourceFixture { @@ -22,7 +22,7 @@ public void GetHost_ReturnSameValue_WithSetValue() Assert.Equal(expectedHost, hostDataSource.Properties.GetValue("Host")); } - [Fact] + [Fact] public void GetPort_ReturnSameValue_WithSetPort() { // Arrange