Пример #1
0
        static void Main(string[] args)
        {
            IDataboxService svc = new DataboxService();

            Console.WriteLine(svc.APIKey);
            Console.WriteLine(svc.UniqueUrl);

            svc.Push(
                new KPI("Kpi1", "value 1"),
                new KPI("KPI2", "Value 2"),
                new KPI("KPI3", "Value 3"));

            svc.Disconnect();

            svc = new DataboxService("API Key", "http://posttestserver.com/post.php?status_code=500");
            ((DataboxService)svc).OnError += new DataboxService.OnErrorDelegate(Program_OnError);

            svc.Push(new KPI[] {
                new KPI("Kpi1", "Value 1"),
                new KPI("Kpi2", "Value 2")
            });

            Console.Read();

            svc.Disconnect();
        }
        public void TestConstructorFromApiKey()
        {
            var randomKey = Guid.NewGuid().ToString();
            var randomUrl = Guid.NewGuid().ToString();

            var svc = new DataboxService(randomKey, randomUrl);

            Assert.IsNotNull(svc);
            Assert.AreEqual(randomKey, svc.APIKey);
            Assert.AreEqual(randomUrl, svc.UniqueUrl);
        }
Пример #3
0
 static void Main(string[] args)
 {
     Databox.Integration.IDataboxService svc = new DataboxService("apikey", "uniqueurl");
 }