using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Xunit; using System.Threading; namespace Cap.Consistency.Test { public class ConsistencyBuilderTest { [Fact] public void CanOverrideMessageStore() { var services = new ServiceCollection(); services.AddConsistency().AddMessageStore(); var thingy = services.BuildServiceProvider().GetRequiredService>() as MyUberThingy; Assert.NotNull(thingy); } private class MyUberThingy : IConsistencyMessageStore { public Task CreateAsync(TestConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } public Task DeleteAsync(TestConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } public void Dispose() { throw new NotImplementedException(); } public Task FindByIdAsync(string messageId, CancellationToken cancellationToken) { throw new NotImplementedException(); } public Task GetMessageIdAsync(TestConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } public Task UpdateAsync(TestConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } } } }