public async Task <GetCompatibilityVersionResponse> Handle(GetCompatibilityVersionRequest request, CancellationToken cancellationToken)
        {
            EnsureArg.IsNotNull(request, nameof(request));

            CompatibleVersions compatibleVersions = await _schemaDataStore.GetLatestCompatibleVersionsAsync(cancellationToken);

            return(new GetCompatibilityVersionResponse(compatibleVersions));
        }
示例#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);
        }