public async Task <IActionResult> GetAsync(string testAggregateIdValue) { var testAggregateId = TestAggregateId.With(testAggregateIdValue); var testAggregate = await _queryProcessor.ProcessAsync(new ReadModelByIdQuery <TestReadModel>(testAggregateId), default); return(Ok(testAggregate)); }
public void Identity_Created_WithGuid() { var guid = Guid.NewGuid(); var testId = TestAggregateId.With(guid); testId.GetGuid().Should().Be(guid); }
public void Arguments(string aggregateId, int magicNumber, string expectedSouceId) { var testId = TestAggregateId.With(aggregateId); var command = new MyDistinctCommand(testId, magicNumber); var sourceId = command.SourceId; sourceId.Value.Should().Be(expectedSouceId); }
public void Identity_Valid_WithValue(string value, string expectedGuidValue) { TestAggregateId testId = null; var expectedGuid = Guid.Parse(expectedGuidValue); Action action = () => testId = TestAggregateId.With(value); action.Should().NotThrow(); testId.Should().NotBeNull(); testId.Value.Should().Be(value); testId.GetGuid().Should().Be(expectedGuid); }
public void Identity_CannotCreate_WithBadIds(string badIdValue) { Action action = () => TestAggregateId.With(badIdValue); action.Should().Throw <ArgumentException>(); }
public void Hydrate(TestAsyncSagaSnapshot aggregateSnapshot) { Sender = TestAggregateId.With(aggregateSnapshot.SenderId); Receiver = TestAggregateId.With(aggregateSnapshot.ReceiverId); Test = new Entities.Test(TestId.With(aggregateSnapshot.Test.Id)); }