Ejemplo n.º 1
0
        public static async Task Main(string[] args)
        {
            InfluxLibrary influx = new InfluxLibrary("http://134.209.204.150:8086", "SimulatorUser", "2k6qzXbefhvtVsYEojztgkQ7UZqVk2UbmQmTgM2CauGfqDtTCcQLFKrcxYk3s36L");

            await influx.WriteTimeSeriesIntAsync(GetTimeSeriesInt());

            await influx.WriteTimeSeriesDoubleAsync(GetTimeSeriesDouble());
        }
Ejemplo n.º 2
0
        public async Task InfluxDB_CanGetDataBase()
        {
            InfluxLibrary influx = new InfluxLibrary("http://134.209.204.150:8086", "SimulatorUser", "2k6qzXbefhvtVsYEojztgkQ7UZqVk2UbmQmTgM2CauGfqDtTCcQLFKrcxYk3s36L");

            List <string> database = await influx.GetDatabasesAsync();

            Assert.IsTrue(database.Count == 4);
        }
Ejemplo n.º 3
0
        public async Task InfluxDB_Write_With_All_Format()
        {
            int expected = 6;

            InfluxLibrary influx = new InfluxLibrary("http://134.209.204.150:8086", "SimulatorUser", "2k6qzXbefhvtVsYEojztgkQ7UZqVk2UbmQmTgM2CauGfqDtTCcQLFKrcxYk3s36L");

            await influx.WriteTimeSeriesIntAsync(GetTimeSeriesInt());

            await influx.WriteTimeSeriesDoubleAsync(GetTimeSeriesDouble());

            var actual = await influx.GetDatabaseStructure("Test");

            Assert.AreEqual(expected, actual["autogen"].Count);
        }
Ejemplo n.º 4
0
        public async Task Check_If_dataBase_GetConnection_Error_Ip_Address()
        {
            InfluxLibrary influx = new InfluxLibrary("http://134.209.204.150:808", "SimulatorUser", "2k6qzXbefhvtVsYEojztgkQ7UZqVk2UbmQmTgM2CauGfqDtTCcQLFKrcxYk3s36L");

            await Assert.ThrowsExceptionAsync <ServiceUnavailableException>(() => influx.GetDatabasesAsync());
        }
Ejemplo n.º 5
0
        public async Task Check_If_dataBase_GetConnection_Error_Username_Password()
        {
            InfluxLibrary influx = new InfluxLibrary("http://134.209.204.150:8086", "SimulatorUser", "2k6qzXbefhvtVsYEojztgkQ7UZqVk2UbmQmTgM2CauGfqDtTCcQLFKrcxYk3s36");

            await Assert.ThrowsExceptionAsync <System.UnauthorizedAccessException>(() => influx.GetDatabasesAsync());
        }