Exemplo n.º 1
0
        public async Task Test(bool canWrite, int expectedCount)
        {
            var options = new AuditTrailClientOptions
            {
                ResendIntervalInSeconds = 0
            };
            var            items   = new[] { new AuditTrailItem(), new AuditTrailItem(), new AuditTrailItem() };
            TestSink       sink    = new TestSink(canWrite);
            TestTokenStore store   = new TestTokenStore(items);
            var            service = new AuditTrailRecoveryService(Options.Create(options), new TestLogger <AuditTrailRecoveryService>(), store, sink);

            await service.StartAsync(default);
Exemplo n.º 2
0
        public void Ctor()
        {
            IOptions <AuditTrailClientOptions> options = Options.Create(new AuditTrailClientOptions());
            TestSink       sink  = new TestSink(true);
            TestTokenStore store = new TestTokenStore(null);
            TestLogger <AuditTrailRecoveryService> testLogger = new TestLogger <AuditTrailRecoveryService>();
            var service = new AuditTrailRecoveryService(options, testLogger, store, sink);

            Assert.Throws <ArgumentNullException>("options", () => new AuditTrailRecoveryService(null !, testLogger, store, sink));
            Assert.Throws <ArgumentNullException>("logger", () => new AuditTrailRecoveryService(options, null !, store, sink));
            Assert.Throws <ArgumentNullException>("store", () => new AuditTrailRecoveryService(options, testLogger, null !, sink));
            Assert.Throws <ArgumentNullException>("sink", () => new AuditTrailRecoveryService(options, testLogger, store, null !));
        }