Esempio n. 1
0
        public void AdaptPersonFromModelToEntity()
        {
            // arrange
            var fromValue = PersonTestUtility.CreateModel();
            var toValue   = new Benday.EasyAuthDemo.Api.DataAccess.Entities.PersonEntity();

            // act
            SystemUnderTest.Adapt(fromValue, toValue);

            // assert
            PersonTestUtility.AssertAreEqual(fromValue, toValue);
        }
Esempio n. 2
0
 public static void AssertAreEqual(
     Benday.EasyAuthDemo.Api.DataAccess.Entities.PersonEntity expected,
     Benday.EasyAuthDemo.Api.DomainModels.Person actual)
 {
     Assert.AreEqual <int>(expected.Id, actual.Id, "Id");
     Assert.AreEqual <string>(expected.FirstName, actual.FirstName, "FirstName");
     Assert.AreEqual <string>(expected.LastName, actual.LastName, "LastName");
     Assert.AreEqual <string>(expected.PhoneNumber, actual.PhoneNumber, "PhoneNumber");
     Assert.AreEqual <string>(expected.EmailAddress, actual.EmailAddress, "EmailAddress");
     Assert.AreEqual <string>(expected.Status, actual.Status, "Status");
     Assert.AreEqual <string>(expected.CreatedBy, actual.CreatedBy, "CreatedBy");
     Assert.AreEqual <DateTime>(expected.CreatedDate, actual.CreatedDate, "CreatedDate");
     Assert.AreEqual <string>(expected.LastModifiedBy, actual.LastModifiedBy, "LastModifiedBy");
     Assert.AreEqual <DateTime>(expected.LastModifiedDate, actual.LastModifiedDate, "LastModifiedDate");
     Assert.AreEqual <byte[]>(expected.Timestamp, actual.Timestamp, "Timestamp");
 }
Esempio n. 3
0
        public static Benday.EasyAuthDemo.Api.DataAccess.Entities.PersonEntity CreateEntity()
        {
            var fromValue = new Benday.EasyAuthDemo.Api.DataAccess.Entities.PersonEntity();

            fromValue.Id               = UnitTestUtility.GetFakeValueForInt("Id");
            fromValue.FirstName        = UnitTestUtility.GetFakeValueForString("FirstName");
            fromValue.LastName         = UnitTestUtility.GetFakeValueForString("LastName");
            fromValue.PhoneNumber      = UnitTestUtility.GetFakeValueForString("PhoneNumber");
            fromValue.EmailAddress     = UnitTestUtility.GetFakeValueForString("EmailAddress");
            fromValue.Status           = UnitTestUtility.GetFakeValueForString("Status");
            fromValue.CreatedBy        = UnitTestUtility.GetFakeValueForString("CreatedBy");
            fromValue.CreatedDate      = UnitTestUtility.GetFakeValueForDateTime("CreatedDate");
            fromValue.LastModifiedBy   = UnitTestUtility.GetFakeValueForString("LastModifiedBy");
            fromValue.LastModifiedDate = UnitTestUtility.GetFakeValueForDateTime("LastModifiedDate");
            fromValue.Timestamp        = UnitTestUtility.GetFakeValueForByteArray("Timestamp");



            return(fromValue);
        }