public async Task Find_returns_null_if_blob_not_found() { var userId = Guid.NewGuid(); IMemento actual = await sut.Find <FakeUser>(userId, CancellationToken.None); actual.Should().BeNull(); }
public async Task Find_returns_null_if_not_exists(Guid sourceId) { IMemento actual = await sut.Find <FakeUser>(sourceId, CancellationToken.None); actual.Should().BeNull(); }
public async Task Find_returns_null_if_not_exists() { var sourceId = Guid.NewGuid(); var sut = new SqlMementoStore( () => new MementoStoreDbContext(_dbContextOptions), new JsonMessageSerializer()); IMemento actual = await sut.Find <FakeUser>(sourceId, default); actual.Should().BeNull(); }
public async Task Find_returns_memento_correctly() { var sourceId = Guid.NewGuid(); FakeUserMemento memento = _fixture.Create <FakeUserMemento>(); await _sut.Save <FakeUser>(sourceId, memento, CancellationToken.None); IMemento actual = await _sut.Find <FakeUser>(sourceId, CancellationToken.None); actual.Should().BeOfType <FakeUserMemento>(); actual.ShouldBeEquivalentTo(memento); }
public async Task Find_returns_memento_correctly( Guid sourceId, FakeUserMemento memento) { await sut.Save <FakeUser>(sourceId, memento, CancellationToken.None); IMemento actual = await sut.Find <FakeUser>(sourceId, CancellationToken.None); actual.Should().BeOfType <FakeUserMemento>(); actual.ShouldBeEquivalentTo(memento); }
public async Task Find_restores_memento_correctly() { // Arrange var userId = Guid.NewGuid(); FakeUserMemento memento = fixture.Create <FakeUserMemento>(); await sut.Save <FakeUser>(userId, memento, CancellationToken.None); // Act IMemento actual = await sut.Find <FakeUser>(userId, CancellationToken.None); // Assert actual.Should().BeOfType <FakeUserMemento>(); actual.ShouldBeEquivalentTo(memento); }
public async Task Find_returns_memento_correctly() { // Arrange var sourceId = Guid.NewGuid(); var memento = new FakeUserMemento(); var sut = new SqlMementoStore( () => new MementoStoreDbContext(_dbContextOptions), new JsonMessageSerializer()); await sut.Save <FakeUser>(sourceId, memento, default); // Act IMemento actual = await sut.Find <FakeUser>(sourceId, default); // Assert actual.Should().BeOfType <FakeUserMemento>(); actual.ShouldBeEquivalentTo(memento); }