Ejemplo n.º 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 _));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public void ConstructionTest()
 {
     var accessor = new DefaultMessageAccessor();
 }