Пример #1
0
        public async Task PublishAsync_NoValueWithTemplate()
        {
            ExecutionContext.Reset();
            var start = Cleaner.Clean(DateTime.Now);

            var tep = new TestEventPublisher();

            await tep.PublishAsync("domain.entity.123", "create", 123).ConfigureAwait(false);

            Assert.AreEqual(1, tep.Events.Count);
            var ed = tep.Events[0];

            Assert.IsNotNull(ed);
            Assert.AreEqual("domain.entity.123", ed.Subject);
            Assert.AreEqual("create", ed.Action);
            Assert.AreEqual(123, ed.Key);
            Assert.IsFalse(ed.HasValue);
            Assert.IsTrue(ed.Timestamp >= start);
        }