using System; using System.Threading; using System.Threading.Tasks; using Cap.Consistency.Infrastructure; using Cap.Consistency.Store; 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(ConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } public Task DeleteAsync(ConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } public void Dispose() { throw new NotImplementedException(); } public Task FindByIdAsync(string messageId, CancellationToken cancellationToken) { throw new NotImplementedException(); } public Task GeConsistencyMessageIdAsync(ConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } public Task GetMessageIdAsync(ConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } public Task UpdateAsync(ConsistencyMessage message, CancellationToken cancellationToken) { throw new NotImplementedException(); } } } }