Пример #1
0
        public void LogExtensions_141_IsValidDataDelimiter_Validation_Fail_Tests()
        {
            var log = new Witsml141.Log
            {
                DataDelimiter = "long"
            };

            Assert.IsFalse(log.IsValidDataDelimiter());

            // Validate that all digits are invalid
            for (int i = 0; i < 10; i++)
            {
                log.DataDelimiter = i.ToString();
                Assert.IsFalse(log.IsValidDataDelimiter());
            }

            // A space in the delimiter is not allowed
            log.DataDelimiter = "# ";
            Assert.IsFalse(log.IsValidDataDelimiter());

            // A decimal in the delimiter is not allowed
            log.DataDelimiter = ".";
            Assert.IsFalse(log.IsValidDataDelimiter());

            // A "+" in the delimiter is not allowed
            log.DataDelimiter = "+";
            Assert.IsFalse(log.IsValidDataDelimiter());

            // A "-" in the delimiter is not allowed
            log.DataDelimiter = "-";
            Assert.IsFalse(log.IsValidDataDelimiter());
        }
Пример #2
0
        public void LogExtensions_141_IsValidDataDelimiter_Data_Delimiter_Validation_Pass_Tests()
        {
            var log = new Witsml141.Log();

            Assert.IsTrue(log.IsValidDataDelimiter());

            // Test symbols that should pass validation
            log.DataDelimiter = "#";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "*";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "~";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "^";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "$";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "(";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = ")";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "@";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "!";
            Assert.IsTrue(log.IsValidDataDelimiter());

            log.DataDelimiter = "|";
            Assert.IsTrue(log.IsValidDataDelimiter());
        }