Example #1
0
        public void Populate()
        {
            string userName = Guid.NewGuid().ToString();
            Guid userId = Guid.NewGuid();
            string line1 = Guid.NewGuid().ToString();
            string postcodeInward = "BS6";
            string postcodeOutward = "6LT";

            IDataReader stubReader = GetStubReader(userName, userId, line1, postcodeInward, postcodeOutward);

            User user = new User();
            UserMap map = new UserMap();
            map.Populate(user, stubReader);

            Assert.AreEqual(userName, user.Name);
            Assert.AreEqual(userId, user.Id);
            Assert.IsNotNull(user.Address);
            Assert.AreEqual(line1, user.Address.Line1);
            Assert.IsNotNull(user.Address.PostCode);
            Assert.AreEqual("BS6 6LT", user.Address.PostCode.Value);
        }
Example #2
0
        public void Populate()
        {
            string userName        = Guid.NewGuid().ToString();
            Guid   userId          = Guid.NewGuid();
            string line1           = Guid.NewGuid().ToString();
            string postcodeInward  = "BS6";
            string postcodeOutward = "6LT";

            IDataReader stubReader = GetStubReader(userName, userId, line1, postcodeInward, postcodeOutward);

            User    user = new User();
            UserMap map  = new UserMap();

            map.Populate(user, stubReader);

            Assert.AreEqual(userName, user.Name);
            Assert.AreEqual(userId, user.Id);
            Assert.IsNotNull(user.Address);
            Assert.AreEqual(line1, user.Address.Line1);
            Assert.IsNotNull(user.Address.PostCode);
            Assert.AreEqual("BS6 6LT", user.Address.PostCode.Value);
        }