Пример #1
0
 public static OwnerTenantDto ToDto(this OwnerTenant ownertenant)
 {
     return(new OwnerTenantDto
     {
         OccupantCount = ownertenant.OccupantCount,
         OwnerTenantId = ownertenant.OwnerTenantId,
         IsOwner = ownertenant.IsOwner,
         From = ownertenant.From,
         To = ownertenant.To,
         PersonId = ownertenant.PersonId,
         ApartmentId = ownertenant.ApartmentId,
     });
 }
Пример #2
0
        public void OwnertenatDto_Map_To_Entry()
        {
            DateTime       now   = DateTime.Now;
            OwnerTenantDto otdto = new OwnerTenantDto {
                PersonId        = 1, From = now, IsOwner = false, OccupantCount = 4
                , OwnerTenantId = 7, ApartmentId = 4
            };
            OwnerTenant ow = otdto.ToEntry();

            bool check = false;

            if (ow.IsOwner == otdto.IsOwner && ow.From == otdto.From && ow.ApartmentId == otdto.ApartmentId &&
                ow.OccupantCount == otdto.OccupantCount && ow.PersonId == otdto.PersonId)
            {
                check = true;
            }
            Assert.IsTrue(check);
        }