comparison UnitTests/CS/Mapping/Person.mapping.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2
3 using NUnit.Framework;
4
5 using BLToolkit.Data;
6 using BLToolkit.Reflection.Extension;
7
8 namespace Mapping
9 {
10 [TestFixture]
11 public class PersonMappingTest
12 {
13 [TypeExtension(FileName="Person.mapping.xml")]
14 public abstract class Person : BLToolkit.EditableObjects.EditableObject
15 {
16 public abstract string FirstName { get; set; }
17 public abstract string LastName { get; set; }
18 }
19
20 [Test]
21 public void Test()
22 {
23 string cmd = "SELECT '1' as FIRST_NAME, '2' as LAST_NAME";
24 #if ORACLE || FIREBIRD
25 cmd += " FROM dual";
26 #endif
27
28 using (DbManager db = new DbManager())
29 {
30 Person p = (Person)db
31 .SetCommand(cmd)
32 .ExecuteObject(typeof(Person));
33
34 Assert.AreEqual("1", p.FirstName);
35 Assert.AreEqual("2", p.LastName);
36 }
37 }
38 }
39 }