Provides common test doubles for use in testing the OnTopic Library.
Note: This package is primarily intended for use by other OnTopic libraries that benefit from sharing testing infrastructure; most OnTopic implementations should not require this package.
Installation can be performed by providing a <PackageReference /> to the OnTopic.TestDoubles NuGet package.
<Project Sdk="Microsoft.NET.Sdk.Web">
…
<ItemGroup>
<PackageReference Include="OnTopic.TestDoubles" Version="5.0.0" />
</ItemGroup>
</Project>Dummies provide no actual functionality and are not expected to function correctly if called. They are simply provided to satisfy the inferface requirement of dependencies, so that a service can be constructed.
Stubs not only satisfy the interface, but will return canned data that tests can operate against, thus allowing unit tests to interact with predetermined scenarios against the service.
The StubTopicRepository automatically generates an in-memory topic graph with the following structure:
Root(Container)Configuration(Container)ContentTypes(ContentTypeDescriptor)ContentTypeDescriptor(ContentTypeDescriptor)AttributeDescriptor(ContentTypeDescriptor)BooleanAttributeDescriptor(ContentTypeDescriptor)NestedTopicListAttributeDescriptor(ContentTypeDescriptor)NumberAttributeDescriptor(ContentTypeDescriptor)RelationshipAttributeDescriptor(ContentTypeDescriptor)TextAttributeDescriptor(ContentTypeDescriptor)TopicReferenceAttributeDescriptor(ContentTypeDescriptor)
Page(ContentTypeDescriptor)Contact(ContentTypeDescriptor)
Metadata(Container)Categories(Lookup)
Web(Container)Web_0(Page)Web_0_0(Page)Web_0_0_0(Page)Web_0_0_0_0(Page)Web_0_0_0_1(Page)
Web_0_0_1(Page)Web_0_0_1_0(Page)Web_0_0_1_1(Page)
Web_1(Page)Web_1_0(Page)Web_1_0_0(Page)Web_1_0_0_0(Page)Web_1_0_0_1(Page)
Web_1_0_1(Page)Web_1_0_1_0(Page)Web_1_0_1_1(Page)
Web_1_1(Page)Web_1_1_0(Page)Web_1_1_0_0(Page)Web_1_1_0_1(Page)
Web_1_1_1(Page)Web_1_1_1_0(Page)Web_1_1_1_1(Page)
Web_3(PageGroup)Web_3_0(Page)Web_3_1(Page)