Skip to content

Commit 619ba62

Browse files
committed
Fixed bug in unit tests regarding CurrentWebPath
The previous bug with the assignment of the `CurrentWebPath` was allowed to go live because the `TopicViewComponentTest` was still comparing it to the `GetUniqueKey()`. This is now resolved as well, so this should be easier to detect in the future.
1 parent ec4886c commit 619ba62

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

OnTopic.AspNetCore.Mvc.Tests/TopicViewComponentTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public async Task Menu_Invoke_ReturnsNavigationViewModel() {
114114
var model = concreteResult?.ViewData.Model as NavigationViewModel<NavigationTopicViewModel>;
115115

116116
Assert.IsNotNull(model);
117-
Assert.AreEqual<string?>(_topic.GetUniqueKey(), model?.CurrentWebPath);
117+
Assert.AreEqual<string?>(_topic.GetWebPath(), model?.CurrentWebPath);
118118
Assert.AreEqual<string?>("/Web/", model?.NavigationRoot?.WebPath);
119119
Assert.AreEqual<int?>(3, model?.NavigationRoot?.Children.Count);
120120
Assert.IsTrue(model?.NavigationRoot?.IsSelected(_topic.GetWebPath())?? false);
@@ -139,7 +139,7 @@ public async Task PageLevelNavigation_Invoke_ReturnsNavigationViewModel() {
139139
var model = concreteResult?.ViewData.Model as NavigationViewModel<NavigationTopicViewModel>;
140140

141141
Assert.IsNotNull(model);
142-
Assert.AreEqual<string?>(_topic.GetUniqueKey(), model?.CurrentWebPath);
142+
Assert.AreEqual<string?>(_topic.GetWebPath(), model?.CurrentWebPath);
143143
Assert.AreEqual<string?>("/Web/Web_3/", model?.NavigationRoot?.WebPath);
144144
Assert.AreEqual<int?>(2, model?.NavigationRoot?.Children.Count);
145145
Assert.IsTrue(model?.NavigationRoot?.IsSelected(_topic.GetWebPath())?? false);

0 commit comments

Comments
 (0)