Example #1
0
        public void ShouldPassMeasurementAndFieldSetOnly()
        {
            string point = "parity blocknum=123456,numpeers=12,blockts=1465839830100400200,numtxinblock=23,propagationtime=0";

            bool result = InfluxPointVerifier.VerifyPoint(point);

            result.Should().BeTrue();
        }
Example #2
0
        public void ShouldPassOptionalTimeStamp()
        {
            string point = "parity,nodeid=0x000000000000000000 blocknum=123456,numpeers=12,blockts=1465839830100400200,numtxinblock=23,propagationtime=0";

            bool result = InfluxPointVerifier.VerifyPoint(point);

            result.Should().BeTrue();
        }
Example #3
0
        public void ShouldNotAllowEmptyInput()
        {
            string point = "";

            var exception = Assert.Throws <Exception>(() => InfluxPointVerifier.VerifyPoint(point));

            Assert.NotNull(exception);
            Assert.Contains("Invalid Point there must be at least measurement and fieldset seperated by a space, or there must not be tokens other then (measurementtagset fieldset timestamp)", exception.Message);
        }
Example #4
0
        public void ShouldNotPassInvalidTimeStamp()
        {
            string point = "parity,nodeid=0x00000000000000000000000,client=Parityv123 blocknum=123456,numpeers=12,blockts=1465839830100400200,numtxinblock=23,propagationtime=0 1465839ert830100400200";

            //Assert.Throws<Exception>(() => InfluxPointVerifier.verifyPoint(point));
            var exception = Assert.Throws <Exception>(() => InfluxPointVerifier.VerifyPoint(point));

            Assert.NotNull(exception);
            Assert.Contains("Invalid timestamp", exception.Message);
        }
Example #5
0
        public void ShouldPassValidPoint(string point)
        {
            bool result = InfluxPointVerifier.VerifyPoint(point);

            result.Should().BeTrue();
        }