Skip to content

Commit c75bbe2

Browse files
committed
Renamed GetContentTypeDescriptorsProxy()
Since `TopicRepositoryBase.GetContentTypeDescriptors(ContentTypeDescriptor)` has been marked as deprecated, in preference for the new `SetContentTypeDescriptors()` method (f1ade10), the `GetContentTypeDescriptorsProxy()` needs to be updated to call the new method. While I was at it, I also deprecated the previous proxy itself, and introduced a new proxy that maps to the new name. This is perhaps not necessary since this is exclusively used by the `OnTopic.Tests`. The `StubTopicRepository` is publicly published via the `Ontopic.TestDoubles` package, however, so that it can be shared with other OnTopic related projects, such as `OnTopic-MVC`. This will help ensure compatibility with those projects.
1 parent 2210b29 commit c75bbe2

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

OnTopic.TestDoubles/StubTopicRepository.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,16 @@ public IEnumerable<AttributeValue> GetAttributesProxy(
180180
| METHOD: GET CONTENT TYPE DESCRIPTORS (PROXY)
181181
\-------------------------------------------------------------------------------------------------------------------------*/
182182
/// <inheritdoc cref="TopicRepositoryBase.GetContentTypeDescriptors(ContentTypeDescriptor)" />
183+
[Obsolete("Deprecated. Instead, use the new SetContentTypeDescriptorsProxy(), which provides the same function.", false)]
183184
public ContentTypeDescriptorCollection GetContentTypeDescriptorsProxy(ContentTypeDescriptor topicGraph) =>
184-
base.GetContentTypeDescriptors(topicGraph);
185+
base.SetContentTypeDescriptors(topicGraph);
186+
187+
/*==========================================================================================================================
188+
| METHOD: SET CONTENT TYPE DESCRIPTORS (PROXY)
189+
\-------------------------------------------------------------------------------------------------------------------------*/
190+
/// <inheritdoc cref="TopicRepositoryBase.SetContentTypeDescriptors(ContentTypeDescriptor)" />
191+
public ContentTypeDescriptorCollection SetContentTypeDescriptorsProxy(ContentTypeDescriptor topicGraph) =>
192+
base.SetContentTypeDescriptors(topicGraph);
185193

186194
/*==========================================================================================================================
187195
| METHOD: GET CONTENT TYPE DESCRIPTOR (PROXY)

OnTopic.Tests/TopicRepositoryBaseTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public void GetContentTypeDescriptors_WithTopicGraph_ReturnsMergedContentTypes()
321321
var newContentType = TopicFactory.Create("NewContentType", "ContentTypeDescriptor", rootContentType);
322322
var contentTypeCount = contentTypes.Count;
323323

324-
_topicRepository.GetContentTypeDescriptorsProxy(rootContentType);
324+
_topicRepository.SetContentTypeDescriptorsProxy(rootContentType);
325325

326326
Assert.AreNotEqual<int>(contentTypeCount, contentTypes.Count);
327327
Assert.IsNotNull(contentTypes.Contains(newContentType));

0 commit comments

Comments
 (0)