Exemple #1
0
        public void AccessingNoneTest()
        {
            var accessor = new DefaultMessageAccessor();
            var message  = new EmptyMessage();

            Assert.IsFalse(accessor.TryGetEntityId(message, out _));
            Assert.IsFalse(accessor.TryGetConcurrencyToken(message, out _));
        }
Exemple #2
0
        public void AccessingIdOnlyTest()
        {
            var id = Guid.NewGuid();

            var accessor = new DefaultMessageAccessor();
            var message  = new MessageWithIdOnly(id);

            Assert.IsTrue(accessor.TryGetEntityId(message, out var aId));
            Assert.IsFalse(accessor.TryGetConcurrencyToken(message, out _));
            Assert.AreEqual(id.ToString(), aId);
        }
Exemple #3
0
        public void AccessingCommandTest()
        {
            var id = Guid.NewGuid();
            var concurrencyToken = Guid.NewGuid().ToString();

            var accessor = new DefaultMessageAccessor();
            var message  = new TestCommand(id, concurrencyToken);

            Assert.IsTrue(accessor.TryGetEntityId(message, out var aId));
            Assert.IsTrue(accessor.TryGetConcurrencyToken(message, out var aConcurrencyToken));
            Assert.AreEqual(id.ToString(), aId);
            Assert.AreEqual(concurrencyToken, aConcurrencyToken);
        }