コード例 #1
0
        public async Task RetrieveNewCharacterIdFromRepository()
        {
            var expectedCharacter = new Domain.RpgCharacter();

            repository.Create().Returns(expectedCharacter);

            var response = await handler.Handle(new CreateRpgCharacterRequest(), CancellationToken.None);

            response.CharacterId.Should().Be(expectedCharacter.Id);
        }
コード例 #2
0
        public async Task <CreateRpgCharacterResponse> Handle(CreateRpgCharacterRequest request, CancellationToken cancellationToken)
        {
            var character = await repository.Create();

            return(new CreateRpgCharacterResponse(character.Id));
        }