public EventData Translate(With.Message.IRegister message) { Registered value = _mapper.Map(message); string text = _serializer.Serialize(value); byte[] data = _encoder.Encode(text); return(new EventData(Guid.NewGuid(), typeof(Registered).FullName, true, data, new byte[0])); }
public void ShouldBeAbleToMapRegistrationMessage() { With.Message.IRegister registration = A.Fake <With.Message.IRegister>(); A.CallTo(() => registration.Registrar).Returns(Identity); A.CallTo(() => registration.Entity).Returns(Entity); State.Event.Mapper subject = new State.Event.Mapper(); State.Event.Registered actual = subject.Map(registration); Assert.AreEqual(registration.Registrar.ToString(), actual.Registrar.Value); Assert.IsNotNull(registration.Entity); }
public Registered Map(With.Message.IRegister message) { return(TypeMapper.Map <Registered>(message)); }