public void ParseConfigFileCorrectlyTest()
        {
            SecureNativeOptions options = ConfigurationManager.LoadConfig();

            Assert.IsNotNull(options);
            Assert.AreEqual("SOME_API_KEY", options.GetApiKey());
            Assert.AreEqual("SOME_API_URL", options.GetApiUrl());
            Assert.AreEqual(true, options.IsAutoSend());
            Assert.AreEqual(false, options.IsDisabled());
            Assert.AreEqual(FailOverStrategy.FAIL_CLOSED, options.GetFailOverStrategy());
            Assert.AreEqual(1000, options.GetInterval());
            Assert.AreEqual("fatal", options.GetLogLevel());
            Assert.AreEqual(100, options.GetMaxEvents());
            Assert.AreEqual(1500, options.GetTimeout());
            Assert.AreEqual(1, options.GetProxyHeaders().Length);
        }
예제 #2
0
        public VerifyResult Verify(EventOptions eventOptions)
        {
            Logger.Info("Verify event call");
            var e = new SdkEvent(eventOptions, _options);

            try
            {
                var res = _eventManager.SendSync(e, ApiRoute.VERIFY);
                return(JsonConvert.DeserializeObject <VerifyResult>(res.GetBody()));
            }
            catch (Exception ex)
            {
                Logger.Error($"Failed to call verify; {ex.Message}");
                return(FailOverStrategy.FAIL_OPEN.Equals(_options.GetFailOverStrategy()) ?
                       new VerifyResult(RiskLevel.LOW, 0, new string[0])
                        : new VerifyResult(RiskLevel.HIGH, 1, new string[0]));
            }
        }