Skip to content

Rewrite Tutorial06-10 tests to use real channel classes with MockEndpoints#55

Merged
devstress merged 20 commits intomainfrom
copilot/redo-tutorials-end-to-end-integration
Apr 6, 2026
Merged

Rewrite Tutorial06-10 tests to use real channel classes with MockEndpoints#55
devstress merged 20 commits intomainfrom
copilot/redo-tutorials-end-to-end-integration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

  • Create src/Testing library with real mock implementations for all 19 EIP interfaces
  • Rewrite all 31 NSubstitute files to use real mock implementations
  • Remove NSubstitute package reference from TutorialLabs
  • All 470 tests pass with zero NSubstitute usage

Copilot AI and others added 3 commits April 6, 2026 09:39
… tutorial tests

Agent-Logs-Url: https://github.com/devstress/My3DLearning/sessions/d69f67ee-ec32-4682-83b7-da586b773c73

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Replace NSubstitute mocks and reflection-based assertions with real
send/receive through MockEndpoint and AspireIntegrationTestHost:

- Tutorial01 (Canonical Data Model): 6 Lab + 3 Exam tests
- Tutorial02 (Service Activator): 6 Lab + 3 Exam tests
- Tutorial03 (Message Channel): 6 Lab + 3 Exam tests
- Tutorial04 (Envelope Wrapper): 7 Lab + 3 Exam tests
- Tutorial05 (Message Endpoint): 6 Lab + 3 Exam tests

All 46 tests pass with real E2E message flow through MockEndpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
…oints

Replace NSubstitute-based mock tests with end-to-end integration tests
that wire real EIP components (PointToPointChannel, PublishSubscribeChannel,
DatatypeChannel, InvalidMessageChannel, ContentBasedRouter, MessageFilter,
PipelineOrchestrator) with MockEndpoints for E2E verification.

- Tutorial06: 7 Lab + 3 Exam tests for messaging channels
- Tutorial07: 6 Lab + 3 Exam tests for Temporal workflow orchestration
- Tutorial08: 6 Lab + 3 Exam tests for activities pipeline
- Tutorial09: 7 Lab + 3 Exam tests for content-based router
- Tutorial10: 7 Lab + 3 Exam tests for message filter

All 48 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Copilot AI and others added 4 commits April 6, 2026 11:16
Rewrote all 10 test files to follow the Tutorial09 gold-standard E2E pattern:
- Tutorial11: Dynamic Router (7 lab + 3 exam tests)
- Tutorial12: Recipient List (6 lab + 3 exam tests)
- Tutorial13: Routing Slip (6 lab + 3 exam tests)
- Tutorial14: Process Manager (6 lab + 3 exam tests)
- Tutorial15: Message Translator (6 lab + 3 exam tests)

All 46 tests use real components with MockEndpoint, NullLogger,
Options.Create, and NUnit 4 assertions. NSubstitute only for
ITemporalWorkflowDispatcher and IPayloadTransform.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Rewrite all 10 test files for Tutorials 16-20 following the Tutorial09
gold-standard pattern with MockEndpoint E2E testing:

- Tutorial16: Transform Pipeline (6 Lab + 3 Exam tests)
- Tutorial17: Normalizer (6 Lab + 3 Exam tests)
- Tutorial18: Content Enricher (6 Lab + 3 Exam tests)
- Tutorial19: Content Filter (6 Lab + 3 Exam tests)
- Tutorial20: Splitter (7 Lab + 3 Exam tests)

All 46 tests pass. Each test uses real component implementations wired
to MockEndpoint for E2E verification.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
- Tutorial21: Aggregator (7 lab + 3 exam tests)
- Tutorial22: Scatter-Gather (6 lab + 3 exam tests)
- Tutorial23: Request-Reply (6 lab + 3 exam tests)
- Tutorial24: Retry Framework (6 lab + 3 exam tests)
- Tutorial25: Dead Letter Queue (7 lab + 3 exam tests)

All 47 tests pass with real components + MockEndpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Tutorial26: Message Replay (6 Lab + 3 Exam tests)
Tutorial27: Resequencer (7 Lab + 3 Exam tests)
Tutorial28: Competing Consumers (6 Lab + 3 Exam tests)
Tutorial29: Throttle and Rate Limiting (6 Lab + 3 Exam tests)
Tutorial30: Business Rule Engine (7 Lab + 3 Exam tests)

All 47 tests pass using real implementations with MockEndpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Copilot AI and others added 4 commits April 6, 2026 12:34
Rewrote all 10 test files (5 Labs + 5 Exams) for tutorials 31-35 to use
the E2E MockEndpoint integration pattern consistent with tutorials 09/21.

All 48 tests pass. Each test uses MockEndpoint for E2E verification.
NSubstitute used only for external infrastructure (IHttpConnector,
ISftpConnectionPool, ISftpClient).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
…tern

Rewrote all 10 test files for tutorials 36-40 to follow the E2E
MockEndpoint integration pattern established in Tutorial09 and Tutorial21:

- Tutorial36 (Email Connector): MockEndpoint feeds envelopes to
  EmailConnector, NSubstitute ISmtpClientWrapper for external SMTP
- Tutorial37 (File Connector): MockEndpoint-driven file I/O pipeline,
  NSubstitute IFileSystem for disk operations
- Tutorial38 (Observability): MockEndpoint tracks message flow through
  InMemoryMessageStateStore, CorrelationPropagator integration
- Tutorial39 (System Management): ControlBusPublisher wired with
  MockEndpoint as both IMessageBrokerProducer and IMessageBrokerConsumer,
  SmartProxy request-reply tracking
- Tutorial40 (RAG & AI): MockEndpoint AI-enriched message pipeline,
  NSubstitute for IOllamaService and IRagFlowService

All 48 tests pass (Lab: 6+7+7+7+6=33, Exam: 3+3+3+3+3=15).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
- Tutorial41: InMemoryMessageStateStore + MockEndpoint for message state tracking
- Tutorial42: InMemoryConfigurationStore + InMemoryFeatureFlagService + MockEndpoint
- Tutorial43: EnvironmentOverrideProvider + InMemoryConfigurationStore + MockEndpoint
- Tutorial44: InMemoryFailoverManager + MockEndpoint for failover/failback
- Tutorial45: ContinuousProfiler + MockEndpoint for profiling snapshots

All 47 tests pass (Lab: 6+7+6+7+6=32, Exam: 3+3+3+3+3=15).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Copilot AI and others added 7 commits April 6, 2026 14:40
…EIP interfaces

Agent-Logs-Url: https://github.com/devstress/My3DLearning/sessions/4de030cf-a1de-4f2a-9859-9bd718560bb1

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
…spatcher

Replace NSubstitute mocking with the in-memory MockTemporalWorkflowDispatcher
from EnterpriseIntegrationPlatform.Testing in both Lab.cs and Exam.cs:

- Use ReturnsSuccess()/ReturnsFailure() instead of NSubstitute .Returns()
- Use dispatcher.LastInput/LastWorkflowId instead of Arg.Do captures
- Use dispatcher.AssertDispatchCount() instead of Received() verification
- All test names and assertions remain unchanged

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
…spatcher

Replace NSubstitute mocking in Lab.cs and Exam.cs with
MockTemporalWorkflowDispatcher from EnterpriseIntegrationPlatform.Testing.

- Remove using NSubstitute, add using EnterpriseIntegrationPlatform.Testing
- Replace Substitute.For with new MockTemporalWorkflowDispatcher()
- Replace .Returns(...) with .ReturnsSuccess()
- Replace Arg.Do capture with dispatcher.LastInput
- Replace Received() assertions with dispatcher.LastWorkflowId checks
- All test names and assertion logic preserved

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
…15, Tutorial18

Migrate all 6 test files (Lab.cs and Exam.cs for each tutorial) from
NSubstitute to the built-in mock classes from
EnterpriseIntegrationPlatform.Testing:

- Tutorial08: MockPersistenceActivityService, MockMessageLoggingService
- Tutorial15: MockPayloadTransform<TIn, TOut>
- Tutorial18: MockEnrichmentSource

All test names, structure, and assertion logic remain equivalent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
… Tutorial21, Tutorial31, Tutorial34, Tutorial35

- Tutorial21 Lab/Exam: Use MockAggregationStrategy<string, string>
- Tutorial31 Exam: Use MockEventProjection<int>
- Tutorial34 Lab/Exam: Use MockHttpConnector with WithResponse/WithFailure
- Tutorial35 Lab/Exam: Use MockSftpClient, MockSftpConnectionPool, MockSftpConnector

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Replace NSubstitute-based mocks with concrete mock implementations from
EnterpriseIntegrationPlatform.Testing in Tutorial36 (MockSmtpClient),
Tutorial37 (MockFileSystem), and Tutorial38 (MockObservabilityEventLog
+ MockTraceAnalyzer). All test names and assertion logic preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
…ionPlatform.Testing

Rewrite Tutorial40 (Lab.cs, Exam.cs), Tutorial41 (Exam.cs), and
Tutorial46 (Lab.cs, Exam.cs) to use MockOllamaService, MockRagFlowService,
MockObservabilityEventLog, MockTraceAnalyzer, and MockTemporalWorkflowDispatcher
instead of NSubstitute. All test names and assertion logic remain equivalent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Copilot AI and others added 2 commits April 6, 2026 15:15
…ionPlatform.Testing in Tutorial47 and Tutorial48

- Tutorial47 Lab/Exam: Replace Substitute.For<ICompensationActivityService>() with MockCompensationActivityService and WithStepResult()
- Tutorial48 Lab: Replace Substitute.For<IMessageValidationService>() with MockMessageValidationService and WithResult()
- Tutorial48 Exam: Replace Substitute.For<IPersistenceActivityService>() with MockPersistenceActivityService and AssertSaveCount()
- Remove all 'using NSubstitute;' imports, add 'using EnterpriseIntegrationPlatform.Testing;'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
…Substitute dependency (470 tests pass)

Agent-Logs-Url: https://github.com/devstress/My3DLearning/sessions/4de030cf-a1de-4f2a-9859-9bd718560bb1

Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
@devstress devstress marked this pull request as ready for review April 6, 2026 16:21
@devstress devstress merged commit c7a62de into main Apr 6, 2026
3 checks passed
@devstress devstress deleted the copilot/redo-tutorials-end-to-end-integration branch April 6, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants