public async Task <ActionResult> CompatibilityAsync()
        {
            _logger.LogInformation("Attempting to get compatibility");
            GetCompatibilityVersionResponse compatibleResponse = await _mediator.GetCompatibleVersionAsync(HttpContext.RequestAborted).ConfigureAwait(false);

            return(new JsonResult(compatibleResponse.CompatibleVersions));
        }
Exemple #2
0
        public async Task GivenAMediator_WhenCompatibleRequest_ThenReturnsCompatibleVersions()
        {
            _schemaMigrationDataStore.GetLatestCompatibleVersionsAsync(Arg.Any <CancellationToken>())
            .Returns(new CompatibleVersions(1, 3));
            GetCompatibilityVersionResponse response = await _mediator.GetCompatibleVersionAsync(_cancellationToken);

            Assert.Equal(1, response.CompatibleVersions.Min);
            Assert.Equal(3, response.CompatibleVersions.Max);
        }