public void ReadASingleEvent() { var eventStreamId = new Guid("A0E50259-7345-48F9-84B4-BEEB5CEC662C"); using (var storage = new AtomEventsInMemory()) { var pageSize = 25; var serializer = DataContractContentSerializer.Scan( typeof(UserCreated).Assembly); var obs = new AtomEventObserver <object>( eventStreamId, pageSize, storage, serializer); var userCreated = new UserCreated { UserId = eventStreamId, UserName = "******", Password = "******", Email = "*****@*****.**" }; obs.OnNext(userCreated); IEnumerable <object> events = new FifoEvents <object>( eventStreamId, // a Guid storage, // an IAtomEventStorage object serializer); // an IContentSerializer object var firstEvent = events.First(); var uc = Assert.IsAssignableFrom <UserCreated>(firstEvent); Assert.Equal(userCreated, uc, new SemanticComparer <UserCreated>()); } }
public void ReadASingleEvent() { var eventStreamId = new Guid("A0E50259-7345-48F9-84B4-BEEB5CEC662C"); using (var storage = new AtomEventsInMemory()) { var pageSize = 25; var serializer = new DataContractContentSerializer( new TypeResolutionTable( new TypeResolutionEntry( "urn:grean:samples:user-on-boarding", "user-created", typeof(UserCreated)), new TypeResolutionEntry( "urn:grean:samples:user-on-boarding", "email-verified", typeof(EmailVerified)), new TypeResolutionEntry( "urn:grean:samples:user-on-boarding", "email-changed", typeof(EmailChanged)))); var obs = new AtomEventObserver <object>( eventStreamId, pageSize, storage, serializer); var userCreated = new UserCreated { UserId = eventStreamId, UserName = "******", Password = "******", Email = "*****@*****.**" }; obs.OnNext(userCreated); IEnumerable <object> events = new FifoEvents <object>( eventStreamId, // a Guid storage, // an IAtomEventStorage object serializer); // an IContentSerializer object var firstEvent = events.First(); var uc = Assert.IsAssignableFrom <UserCreated>(firstEvent); Assert.Equal(userCreated, uc, new SemanticComparer <UserCreated>()); } }
public void ReadASingleEvent() { var eventStreamId = new Guid("A0E50259-7345-48F9-84B4-BEEB5CEC662C"); using (var storage = new AtomEventsInMemory()) { var pageSize = 25; var serializer = DataContractContentSerializer.Scan( typeof(UserCreated).Assembly); var obs = new AtomEventObserver<object>( eventStreamId, pageSize, storage, serializer); var userCreated = new UserCreated { UserId = eventStreamId, UserName = "******", Password = "******", Email = "*****@*****.**" }; obs.OnNext(userCreated); IEnumerable<object> events = new FifoEvents<object>( eventStreamId, // a Guid storage, // an IAtomEventStorage object serializer); // an IContentSerializer object var firstEvent = events.First(); var uc = Assert.IsAssignableFrom<UserCreated>(firstEvent); Assert.Equal(userCreated, uc, new SemanticComparer<UserCreated>()); } }