public void AccessingNoneTest() { var accessor = new DefaultMessageAccessor(); var message = new EmptyMessage(); Assert.IsFalse(accessor.TryGetEntityId(message, out _)); Assert.IsFalse(accessor.TryGetConcurrencyToken(message, out _)); }
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); }
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); }