Example #1
0
        public void Live_Replace_Data_In_Dataset()
        {
            // Arrange
            var client = new GeckoConnect();
            var obj    = new GeckoDataset()
            {
                Data = new List <Dictionary <string, object> >()
                {
                    new Dictionary <string, object>()
                    {
                        { "timestamp", "2016-01-01T12:00:00Z" },
                        { "amount", 819 }
                    },
                    new Dictionary <string, object>()
                    {
                        { "timestamp", "2016-01-02T12:00:00Z" },
                        { "amount", 409 }
                    },
                    new Dictionary <string, object>()
                    {
                        { "timestamp", "2016-01-03T12:00:00Z" },
                        { "amount", 164 }
                    }
                }
            };
            var datasetName = "test";

            // Act
            Assert.AreNotEqual("<api key here>", this.apiKey);
            var result = client.UpdateDataset(obj, datasetName, this.apiKey);

            // Assert
            Assert.IsNotNull(result);
        }
Example #2
0
        public void Live_Replace_Data_In_Dataset()
        {
            // Arrange
            var client = new GeckoConnect();

            var obj = new GeckoDataset()
            {
                Fields = new Dictionary <string, IDatasetField>()
                {
                    { "amount", new DatasetField(DatasetFieldType.Number, "Amount") },
                    { "timestamp", new DatasetField(DatasetFieldType.DateTime, "Date") }
                },
                UniqueBy = new List <string>()
                {
                    "timestamp"
                }
            };
            var datasetName = $"test_{Guid.NewGuid().ToString()}";

            // Act
            var result = client.CreateDataset(obj, datasetName, _apiKey);

            var obj2 = new GeckoDataset()
            {
                Data = new List <Dictionary <string, object> >()
                {
                    new Dictionary <string, object>()
                    {
                        { "timestamp", "2016-01-01T12:00:00Z" },
                        { "amount", 819 }
                    },
                    new Dictionary <string, object>()
                    {
                        { "timestamp", "2016-01-02T12:00:00Z" },
                        { "amount", 409 }
                    },
                    new Dictionary <string, object>()
                    {
                        { "timestamp", "2016-01-03T12:00:00Z" },
                        { "amount", 164 }
                    }
                }
            };

            // Act
            Assert.AreNotEqual("<api key here>", _apiKey);
            var result2 = client.UpdateDataset(obj2, datasetName, _apiKey);

            // Assert
            Assert.IsNotNull(result);

            client.DeleteDataset(datasetName, _apiKey);
        }
Example #3
0
        public void Live_Replace_Data_In_Dataset()
        {
            // Arrange
            var client = new GeckoConnect();
            var obj = new GeckoDataset()
            {
                Data = new List<Dictionary<string, object>>()
                {
                    new Dictionary<string, object>()
                    {
                        { "timestamp", "2016-01-01T12:00:00Z" },
                        { "amount", 819 }
                    },
                    new Dictionary<string, object>()
                    {
                        { "timestamp", "2016-01-02T12:00:00Z" },
                        { "amount", 409 }
                    },
                    new Dictionary<string, object>()
                    {
                        { "timestamp", "2016-01-03T12:00:00Z" },
                        { "amount", 164 }
                    }
                }
            };
            var datasetName = "test";

            // Act
            Assert.AreNotEqual("<api key here>", this.apiKey);
            var result = client.UpdateDataset(obj, datasetName, this.apiKey);

            // Assert
            Assert.IsNotNull(result);
        }