Skip to content
This repository was archived by the owner on Nov 25, 2023. It is now read-only.

Commit c90dd1d

Browse files
committed
Unit test the Reddit URL
1 parent 9edf51b commit c90dd1d

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/AboutViewModelTest.cs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public void AboutViewModelConstructor()
2929
Assert.Equal("Pierre CAVAROC", aboutViewModel.CreatorInfoLabel);
3030
Assert.Equal("ErgoDox EZ Configurator", aboutViewModel.BasedOnInfoLabel);
3131
Assert.Equal("EZ Layout Display", aboutViewModel.ProjectHomeInfoLabel);
32-
Assert.Equal("@Invvard", aboutViewModel.ContactInfoLabel);
32+
Assert.Equal("@Invvard", aboutViewModel.TwitterInfoLabel);
33+
Assert.Equal("r/EZLayoutDisplay", aboutViewModel.RedditInfoLabel);
3334
Assert.Equal("OK", aboutViewModel.CloseButtonLabel);
3435
}
3536

@@ -84,7 +85,7 @@ public void NavigateProjectHomeUrl_Execute()
8485
}
8586

8687
[ Fact ]
87-
public void NavigateContactUrl_Execute()
88+
public void NavigateTwitterUrl_Execute()
8889
{
8990
// Arrange
9091
var expectedUrl = "https://twitter.com/invvard";
@@ -94,7 +95,24 @@ public void NavigateContactUrl_Execute()
9495

9596
// Act
9697
var aboutViewModel = new AboutViewModel(mockWindowService.Object, mockProcessService.Object);
97-
aboutViewModel.NavigateContactUrlCommand.Execute(null);
98+
aboutViewModel.NavigateTwitterUrlCommand.Execute(null);
99+
100+
// Assert
101+
mockProcessService.Verify(p => p.StartWebUrl(expectedUrl));
102+
}
103+
104+
[ Fact ]
105+
public void NavigateRedditUrl_Execute()
106+
{
107+
// Arrange
108+
var expectedUrl = "https://www.reddit.com/r/EZLayoutDisplay/";
109+
var mockWindowService = new Mock<IWindowService>();
110+
var mockProcessService = new Mock<IProcessService>();
111+
mockProcessService.Setup(p => p.StartWebUrl(expectedUrl)).Verifiable();
112+
113+
// Act
114+
var aboutViewModel = new AboutViewModel(mockWindowService.Object, mockProcessService.Object);
115+
aboutViewModel.NavigateRedditUrlCommand.Execute(null);
98116

99117
// Assert
100118
mockProcessService.Verify(p => p.StartWebUrl(expectedUrl));

0 commit comments

Comments
 (0)