Mercurial > pub > bltoolkit
view UnitTests/CS/DataAccess/XmlTypeTest.cs @ 4:f757da6161a1
!bug 100 + 2h fixed gregression
author | cin |
---|---|
date | Sun, 24 Aug 2014 17:57:42 +0400 |
parents | f990fcb411a9 |
children |
line wrap: on
line source
using System.Collections.Generic; using NUnit.Framework; using BLToolkit.DataAccess; using BLToolkit.Mapping; namespace DataAccess { [TestFixture] public class XmlTypeTest { public class TestObject { [MapField("DataTypeID")] public int ID; [MapField("Xml_")] public string Xml; } public abstract class TestAccessor : DataAccessor { [SqlQuery("Select * FROM DataTypeTest")] public abstract List<TestObject> LoadAll(); [TestQuery( SqlText = "SELECT * FROM DataTypeTest WHERE DataTypeID=@ID", OracleText = "SELECT * FROM DataTypeTest WHERE DataTypeID=:ID")] public abstract TestObject LoadById(int ID); } [Test] public void Test() { TestAccessor ta = (TestAccessor)DataAccessor.CreateInstance(typeof(TestAccessor)); TestObject o = ta.LoadById(2); Assert.IsNotNull(o); Assert.IsNotNull(o.Xml); List<TestObject> lst = ta.LoadAll(); Assert.IsNotEmpty(lst); Assert.IsNotNull(lst[0].Xml); } } }