public async Task <IActionResult> Get(string key) { var request = new GetValueItemRequest(key); var response = await mediator.Send(request); return(response.ValueItem.Match(r => (IActionResult)Ok(new ValueItem(r)), () => (IActionResult)NotFound(key))); }
public void ValidateTheRequest(string key, bool isValid) { var validator = new GetValueItemValidator(); var request = new GetValueItemRequest(key); var result = validator.Validate(request); result.IsValid.Should().Be(isValid); }