public void can_write_TestEvent_to_store() { var sut = new TestEvent(1234, "TestEvent", 4, "some other datat to test the serialization."); var writer = _store.GetWriter<string, TestEvent>(); writer.Add(sut.Name, sut); var reader = _store.GetReader<string, TestEvent>(); var result = reader.Load(sut.Name); Assert.AreEqual(sut.Name, result.Name); Assert.AreEqual(sut.ObjectId, result.ObjectId); Assert.AreEqual(sut.OtherData, result.OtherData); }
public void can_write_TestWrapper_to_store() { var testEvent = new TestEvent(1234, "TestEvent", 4, "some other datat to test the serialization."); var sut = new TestWrapper("TestWrapper", 1, testEvent, testEvent.GetType().AssemblyQualifiedName, "some other data etc"); var writer = _store.GetWriter<string, TestWrapper>(); writer.Add(sut.Name, sut); var reader = _store.GetReader<string, TestWrapper>(); var result = reader.Load(sut.Name); Assert.AreEqual(sut.Name, result.Name); Assert.AreEqual(sut.ObjectId, result.ObjectId); Assert.AreEqual(sut.OtherData, result.OtherData); var returnEvent = (Event)JsonConvert.DeserializeObject(result.Event.ToString(), Type.GetType(result.Type)); Assert.AreEqual(testEvent.UserId, returnEvent.UserId); }