using System; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Xunit; 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(); } } } }