public async Task MsgByIdDataTest() { using var store = GetDocumentStore(); using var session = store.OpenAsyncSession(); var loader = new MsgById() { Session = session, Id = MsgData.FirstId }; await loader.Execute(); loader.Result.Should().NotBeNull(); loader.Result.Id.Should().Be(MsgData.FirstId); Assert.That(loader.Result, Is.DeepEqualTo(MsgData.GetFirst())); }
public async Task MsgByIdDataTestReply() { using var store = GetDocumentStore(); using var session = store.OpenAsyncSession(); await session.StoreAsync(MsgData.GetSecond()); await session.SaveChangesAsync(); WaitForIndexing(store); var loader = new MsgById() { Session = session, Id = MsgData.SecondId }; await loader.Execute(); loader.Result.Should().NotBeNull(); loader.Result.Id.Should().Be(MsgData.SecondId); Assert.That(loader.Result, Is.DeepEqualTo(MsgData.GetSecond())); }