Skip to content

Commit 4dfa925

Browse files
committed
Fixed generic test
The "generic" test wasn't actually testing the generic overload. Also, removed some unnecessary `SetValue()` instances that weren't being tested.
1 parent 3e2780b commit 4dfa925

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Ignia.Topics.Tests/TopicMappingServiceTest.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ public TopicMappingServiceTest() {
4747
}
4848

4949
/*==========================================================================================================================
50-
| TEST: MAP (INSTANCE)
50+
| TEST: MAP (GENERIC)
5151
\-------------------------------------------------------------------------------------------------------------------------*/
5252
/// <summary>
53-
/// Establishes a <see cref="TopicMappingService"/> and tests setting basic scalar values by providing it with an already
54-
/// constructed instance of a DTO.
53+
/// Establishes a <see cref="TopicMappingService"/> and tests setting basic scalar values by specifying an explicit type.
5554
/// </summary>
5655
[TestMethod]
5756
public async Task TopicMappingService_MapGeneric() {
@@ -63,7 +62,7 @@ public async Task TopicMappingService_MapGeneric() {
6362
topic.Attributes.SetValue("Title", "Value1");
6463
topic.Attributes.SetValue("IsHidden", "1");
6564

66-
var target = (PageTopicViewModel)await mappingService.MapAsync(topic, new PageTopicViewModel());
65+
var target = await mappingService.MapAsync<PageTopicViewModel>(topic);
6766

6867
Assert.AreEqual<string>("ValueA", target.MetaTitle);
6968
Assert.AreEqual<string>("Value1", target.Title);
@@ -115,10 +114,8 @@ public async Task TopicMappingService_MapParents() {
115114
topic.Attributes.SetValue("IsHidden", "1");
116115

117116
parent.Attributes.SetValue("Title", "Value2");
118-
parent.Attributes.SetValue("IsHidden", "1");
119117

120118
grandParent.Attributes.SetValue("Title", "Value3");
121-
grandParent.Attributes.SetValue("IsHidden", "1");
122119
grandParent.Attributes.SetValue("Property", "ValueB");
123120

124121
var viewModel = (PageTopicViewModel) await mappingService.MapAsync(topic);

0 commit comments

Comments
 (0)