コード例 #1
0
        public async Task VesselPositions_InCustomArea_InvalidApiKey()
        {
            var client  = new MarineTrafficApiClient("no-api-key");
            var request = ExportVesselsV8Request.VesselPositions().InCustomArea(0.1, 0.2, 1.5, 1.6);
            var result  = await request.Execute(client);

            LocalTests.VerifyFailed(result);
            Assert.AreEqual(1, result.Errors.Count);
            Assert.AreEqual("10", result.Errors[0].Code);
            Assert.AreEqual(MarineTrafficErrorCode.ServiceKeyNotFound, result.Errors[0].KnownCode);
        }
コード例 #2
0
        public async Task VesselPositions_InCustomArea_NoApiKey()
        {
            var client  = new MarineTrafficApiClient(null);
            var request = ExportVesselsV8Request.VesselPositions().InCustomArea(0.1, 0.2, 1.5, 1.6);
            var result  = await request.Execute(client);

            LocalTests.VerifyFailed(result);
            Assert.AreEqual(1, result.Errors.Count);
            Assert.AreEqual("1", result.Errors[0].Code);
            Assert.AreEqual(MarineTrafficErrorCode.IncorrectCallCheckParameters, result.Errors[0].KnownCode);
        }