Default implementation of IFieldSet.
상속: IFieldSet
예제 #1
0
        public void TestReadRawStringIndex()
        {
            var fieldSet = new DefaultFieldSet(new[] { " string " });

            var read = fieldSet.ReadRawString(0);

            Assert.AreEqual(" string ", read);
        }
예제 #2
0
        public void TestReadRawStringName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { " string " });

            var read = fieldSet.ReadRawString("name");

            Assert.AreEqual(" string ", read);
        }
예제 #3
0
        public void TestReadBooleanIndex2()
        {
            var fieldSet = new DefaultFieldSet(new[] { "Y" });

            var read = fieldSet.ReadBoolean(0, "Y");

            Assert.IsTrue(read);
        }
        public void TestExtractFieldSet()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "value" });

            var result = _extractor.Extract(fieldSet);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Length);
            Assert.AreEqual("value", result[0]);
        }
예제 #5
0
        public void TestReadDateName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "2015-06-03" });

            var read = fieldSet.ReadDate("name");

            Assert.AreEqual(new DateTime(2015, 6, 3), read);
        }
예제 #6
0
        public void TestReadDecimalIndexDefaultValue()
        {
            var fieldSet = new DefaultFieldSet(new[] { " " });

            var read = fieldSet.ReadDecimal(0, 33m);

            Assert.AreEqual(33m, read);
        }
예제 #7
0
        public void TestReadDecimalNameDefaultValye()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { " " });

            var read = fieldSet.ReadDecimal("name", 33m);

            Assert.AreEqual(33m, read);
        }
예제 #8
0
        public void TestReadShortName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "32767" });

            var read = fieldSet.ReadShort("name");

            Assert.AreEqual(32767, read);
        }
예제 #9
0
        public void TestReadDecimalName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "1999.37" });

            var read = fieldSet.ReadDecimal("name");

            Assert.AreEqual(1999.37m, read);
        }
예제 #10
0
        public void TestReadDateNamePatternDefaultValue()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { " " });

            var read = fieldSet.ReadDate("name", "dd/MM/yyyy", new DateTime(1970, 1, 1));

            Assert.AreEqual(new DateTime(1970, 1, 1), read);
        }
예제 #11
0
        public void TestReadByteIndex()
        {
            var fieldSet = new DefaultFieldSet(new[] { "255" });

            var read = fieldSet.ReadByte(0);

            Assert.AreEqual(255, read);
        }
예제 #12
0
        public void TestReadLongIndexDefaultValue()
        {
            var fieldSet = new DefaultFieldSet(new[] { " " });

            var read = fieldSet.ReadLong(0, 2);

            Assert.AreEqual(2, read);
        }
예제 #13
0
        public void TestReadLongNameDefaultValue()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { " " });

            var read = fieldSet.ReadLong("name", 2);

            Assert.AreEqual(2, read);
        }
예제 #14
0
        public void TestReadIntNameDefaultValue()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { " " });

            var read = fieldSet.ReadInt("name", 3);

            Assert.AreEqual(3, read);
        }
예제 #15
0
        public void TestReadLongName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "9223372036854775807" });

            var read = fieldSet.ReadLong("name");

            Assert.AreEqual(9223372036854775807, read);
        }
예제 #16
0
        public void TestReadIntIndexDefaultValue()
        {
            var fieldSet = new DefaultFieldSet(new[] { " " });

            var read = fieldSet.ReadInt(0, 3);

            Assert.AreEqual(3, read);
        }
예제 #17
0
        public void TestReadIntName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "2147483647" });

            var read = fieldSet.ReadInt("name");

            Assert.AreEqual(2147483647, read);
        }
예제 #18
0
        public void TestReadIntIndex()
        {
            var fieldSet = new DefaultFieldSet(new[] { "2147483647" });

            var read = fieldSet.ReadInt(0);

            Assert.AreEqual(2147483647, read);
        }
예제 #19
0
        public void TestReadDateIndexDefaultValue()
        {
            var fieldSet = new DefaultFieldSet(new[] { " " });

            var read = fieldSet.ReadDate(0, new DateTime(1970, 1, 1));

            Assert.AreEqual(new DateTime(1970, 1, 1), read);
        }
예제 #20
0
        public void TestReadBooleanName2()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "Y" });

            var read = fieldSet.ReadBoolean("name", "Y");

            Assert.IsTrue(read);
        }
예제 #21
0
        public void TestReadDateNamePattern()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "04/06/2015" });

            var read = fieldSet.ReadDate("name", "dd/MM/yyyy");

            Assert.AreEqual(new DateTime(2015, 6, 4), read);
        }
예제 #22
0
        public void TestReadBooleanName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "c" });

            var read = fieldSet.ReadChar("name");

            Assert.AreEqual('c', read);
        }
예제 #23
0
        public void TestReadByteName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "255" });

            var read = fieldSet.ReadByte("name");

            Assert.AreEqual(255, read);
        }
예제 #24
0
        public void TestReadDecimalIndex()
        {
            var fieldSet = new DefaultFieldSet(new[] { "1999.37" });

            var read = fieldSet.ReadDecimal(0);

            Assert.AreEqual(1999.37m, read);
        }
예제 #25
0
        public void TestReadDoubleIndex()
        {
            var fieldSet = new DefaultFieldSet(new[] { "2.37" });

            var read = fieldSet.ReadDouble(0);

            Assert.AreEqual(2.37D, read);
        }
예제 #26
0
        public void TestReadShortIndex()
        {
            var fieldSet = new DefaultFieldSet(new[] { "32767" });

            var read = fieldSet.ReadShort(0);

            Assert.AreEqual(32767, read);
        }
예제 #27
0
        public void TestReadDoubleName()
        {
            var fieldSet = new DefaultFieldSet(new[] { "name" }, new[] { "2.37" });

            var read = fieldSet.ReadDouble("name");

            Assert.AreEqual(2.37D, read);
        }
예제 #28
0
        public void TestReadBooleanIndex()
        {
            var fieldSet = new DefaultFieldSet(new[] { "c" });

            var read = fieldSet.ReadChar(0);

            Assert.AreEqual('c', read);
        }