Rename Feedser to Concelier
This commit is contained in:
		@@ -0,0 +1,35 @@
 | 
			
		||||
using Microsoft.Extensions.Logging.Abstractions;
 | 
			
		||||
using StellaOps.Concelier.Storage.Mongo.MergeEvents;
 | 
			
		||||
 | 
			
		||||
namespace StellaOps.Concelier.Storage.Mongo.Tests;
 | 
			
		||||
 | 
			
		||||
[Collection("mongo-fixture")]
 | 
			
		||||
public sealed class MergeEventStoreTests : IClassFixture<MongoIntegrationFixture>
 | 
			
		||||
{
 | 
			
		||||
    private readonly MongoIntegrationFixture _fixture;
 | 
			
		||||
 | 
			
		||||
    public MergeEventStoreTests(MongoIntegrationFixture fixture)
 | 
			
		||||
    {
 | 
			
		||||
        _fixture = fixture;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [Fact]
 | 
			
		||||
    public async Task AppendAndReadMergeEvents()
 | 
			
		||||
    {
 | 
			
		||||
        var store = new MergeEventStore(_fixture.Database, NullLogger<MergeEventStore>.Instance);
 | 
			
		||||
        var record = new MergeEventRecord(
 | 
			
		||||
            Guid.NewGuid(),
 | 
			
		||||
            "ADV-1",
 | 
			
		||||
            new byte[] { 0x01 },
 | 
			
		||||
            new byte[] { 0x02 },
 | 
			
		||||
            DateTimeOffset.UtcNow,
 | 
			
		||||
            new List<Guid> { Guid.NewGuid() },
 | 
			
		||||
            Array.Empty<MergeFieldDecision>());
 | 
			
		||||
 | 
			
		||||
        await store.AppendAsync(record, CancellationToken.None);
 | 
			
		||||
 | 
			
		||||
        var recent = await store.GetRecentAsync("ADV-1", 10, CancellationToken.None);
 | 
			
		||||
        Assert.Single(recent);
 | 
			
		||||
        Assert.Equal(record.AfterHash, recent[0].AfterHash);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user