public void Create() { var id = RandomGuid(); var firstName = RandomGuidString(); var lastName = RandomGuidString(); var stubReader = GetStubReader(id, firstName, lastName); var map = new FullUserFromStubDataReaderMap(); var user = map.Create(stubReader); Assert.IsNotNull(user); Assert.AreEqual(id, user.Id); Assert.AreEqual(firstName, user.FirstName); Assert.AreEqual(lastName, user.LastName); }
public void Create_WithConversion() { var id = RandomGuid(); var firstName = RandomGuidString(); var lastName = RandomGuidString(); var stubReader = GetStubReader(id, firstName, lastName); var map = new FullUserFromStubDataReaderMap() .Specify<string, string>("FIRSTNAME", t => t.FirstName, c => c.ToUpper()); var user = map.Create(stubReader); Assert.IsNotNull(user); Assert.AreEqual(id, user.Id); Assert.AreEqual(firstName.ToUpper(), user.FirstName); Assert.AreEqual(lastName, user.LastName); }
public void Create_WithConversion() { var id = RandomGuid(); var firstName = RandomGuidString(); var lastName = RandomGuidString(); var stubReader = GetStubReader(id, firstName, lastName); var map = new FullUserFromStubDataReaderMap() .Specify <string, string>("FIRSTNAME", t => t.FirstName, c => c.ToUpper()); var user = map.Create(stubReader); Assert.IsNotNull(user); Assert.AreEqual(id, user.Id); Assert.AreEqual(firstName.ToUpper(), user.FirstName); Assert.AreEqual(lastName, user.LastName); }