コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }