Пример #1
0
 public async Task can_read_single_primative_type_async()
 {
     var stubDataReader = new StubDataReader
     {
         Names  = new[] { "ID" },
         Types  = new[] { typeof(long) },
         Values = new object[] { 1L },
     };
     await stubDataReader.AsSeqOf <long>().SingleAsync();
 }
Пример #2
0
 public void can_read_single_nullable_enum()
 {
     var stubDataReader = new StubDataReader
     {
         Names  = new[] { "ID" },
         Types  = new[] { typeof(int) },
         Values = new object[] { 1 },
     };
     var val = stubDataReader.AsSeqOf <TestEnum?>().Single();
 }
Пример #3
0
 public void can_read_single_nullable_primative_type()
 {
     var stubDataReader = new StubDataReader
     {
         Names  = new[] { "ID" },
         Types  = new[] { typeof(long) },
         Values = new object[] { 1L },
     };
     var val = stubDataReader.AsSeqOf <long?>().Single();
 }
Пример #4
0
        public void can_read_single()
        {
            var reader = new StubDataReader
            {
                Names  = new[] { "ID" },
                Types  = new[] { typeof(long) },
                Values = new object[] { 1L },
            };

            reader.AsSeqOf <long>().Single();
        }
Пример #5
0
        public void can_read_into_struct()
        {
            var stubDataReader = new StubDataReader
            {
                Names  = new[] { "VALUE" },
                Types  = new[] { typeof(long) },
                Values = new object[] { 1L },
            };
            var val = stubDataReader.AsSeqOf <TestStruct <long> >().Single();

            Assert.AreEqual(1L, val.Value);
        }
Пример #6
0
        public void can_read_single_object_containing_guid()
        {
            var g = Guid.NewGuid();
            var stubDataReader = new StubDataReader
            {
                Names  = new[] { "VALUE" },
                Types  = new[] { g.GetType() },
                Values = new object[] { g },
            };
            var read = stubDataReader.AsSeqOf <Guid?>().Single();

            Assert.AreEqual(g, read.Value);
        }
Пример #7
0
        public void can_read_single_datetime()
        {
            var dt             = DateTime.Now;
            var stubDataReader = new StubDataReader
            {
                Names  = new[] { "ID" },
                Types  = new[] { dt.GetType() },
                Values = new object[] { dt },
            };
            var read = stubDataReader.AsSeqOf <DateTime>().Single();

            Assert.AreEqual(dt, read);
        }