public void Version_2018_12_16_Preview_Returns_Bad_Request_If_Version_0_2_Is_Requested()
        {
            var request = new DefaultHttpRequest(new DefaultHttpContext())
            {
                Query = new QueryCollection(new Dictionary <string, Microsoft.Extensions.Primitives.StringValues>
                {
                }),
            };

            var actual = FCntCacheCheck.Run(request, NullLogger.Instance, new ExecutionContext(), ApiVersion.Version_2018_12_16_Preview);

            Assert.NotNull(actual);
            Assert.IsType <BadRequestObjectResult>(actual);
            var badRequestResult = (BadRequestObjectResult)actual;

            Assert.Equal("Incompatible versions (requested: '0.2 or earlier', current: '2018-12-16-preview')", badRequestResult.Value.ToString());

            // Ensure current version is added to response
            Assert.Contains(ApiVersion.HttpHeaderName, request.HttpContext.Response.Headers);
            Assert.Equal("2018-12-16-preview", request.HttpContext.Response.Headers[ApiVersion.HttpHeaderName].FirstOrDefault());
        }
示例#2
0
 public NextFCntDownExecutionItem(FCntCacheCheck fCntCacheCheck)
 {
     this.fCntCacheCheck = fCntCacheCheck;
 }
示例#3
0
 public FCntCacheCheckTest()
 {
     this.fcntCheck = new FCntCacheCheck(new LoRaInMemoryDeviceStore());
 }