Ejemplo n.º 1
0
        public void Map_ContactInfo_ReturnsContactInfo()
        {
            ContactInfo contactInfo = new ContactInfo
            {
                Email     = String.Format("{0}@okb.no", Guid.NewGuid().ToString("N")),
                FirstName = Guid.NewGuid().ToString("N"),
                LastName  = Guid.NewGuid().ToString("N"),
                Phone     = "1234568",
            };

            Models.ContactInfo mappedContactInfo =
                Mapper.Map <Models.ContactInfo>(contactInfo);

            Assert.That(mappedContactInfo, Is.Not.Null, "ContactInfo");
            Assert.That(mappedContactInfo.Email, Is.EqualTo(contactInfo.Email), "ContactInfo.Email");
            Assert.That(mappedContactInfo.FirstName, Is.EqualTo(contactInfo.FirstName), "ContactInfo.FirstName");
            Assert.That(mappedContactInfo.LastName, Is.EqualTo(contactInfo.LastName), "ContactInfo.LastName");
            Assert.That(
                mappedContactInfo.Phone,
                Is.EqualTo(contactInfo.Phone),
                "ContactInfo.MobilePhoneNumber");
        }
Ejemplo n.º 2
0
        public void Map_ContactInfo_ReturnsContactInfo()
        {
            ContactInfo contactInfo = new ContactInfo
            {
                Email = String.Format("{0}@okb.no", Guid.NewGuid().ToString("N")),
                FirstName = Guid.NewGuid().ToString("N"),
                LastName = Guid.NewGuid().ToString("N"),
                Phone = "1234568",
            };

            Models.ContactInfo mappedContactInfo =
                Mapper.Map<Models.ContactInfo>(contactInfo);

            Assert.That(mappedContactInfo, Is.Not.Null, "ContactInfo");
            Assert.That(mappedContactInfo.Email, Is.EqualTo(contactInfo.Email), "ContactInfo.Email");
            Assert.That(mappedContactInfo.FirstName, Is.EqualTo(contactInfo.FirstName), "ContactInfo.FirstName");
            Assert.That(mappedContactInfo.LastName, Is.EqualTo(contactInfo.LastName), "ContactInfo.LastName");
            Assert.That(
                mappedContactInfo.Phone,
                Is.EqualTo(contactInfo.Phone),
                "ContactInfo.MobilePhoneNumber");
        }