Skip to content

Latest commit

 

History

History

README.md

TestDoubles

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.

OnTopic.TestDoubles package in Internal feed in Azure Artifacts Build Status NuGet Deployment Status

Contents

Installation

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>

Inventory

Dummies

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

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.

StubTopicRepository

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)