コード例 #1
0
 public void Initialize()
 {
     architectEntity = new ArchitectEntity()
     {
         Id        = new Guid("97F201CD-9567-4361-8239-61EA74BBD2CD"),
         FirstName = "Dumitru",
         LastName  = "Mafia",
         StartDate = new DateTime(2008, 3, 15),
         EndDate   = new DateTime(2019, 3, 15),
         Salary    = 2250
     };
 }
コード例 #2
0
        private ArchitectEntity ArhitectToEntiy(Architect toConvert)
        {
            ArchitectEntity conversion = new ArchitectEntity()
            {
                Name             = toConvert.Name,
                Surname          = toConvert.Surname,
                UserName         = toConvert.UserName,
                Password         = toConvert.Password,
                RegistrationDate = toConvert.RegistrationDate,
                LastLoginDate    = toConvert.LastLoginDate
            };

            return(conversion);
        }
コード例 #3
0
        private Architect EntityToArchitect(ArchitectEntity toConvert)
        {
            if (toConvert == null)
            {
                throw new ArgumentNullException();
            }
            Architect conversion;

            try
            {
                conversion = new Architect(toConvert.Name, toConvert.Surname, toConvert.UserName, toConvert.Password, toConvert.RegistrationDate, toConvert.LastLoginDate);
            }
            catch (ArgumentNullException) {
                throw new InconsistentDataException();
            }
            return(conversion);
        }
コード例 #4
0
 public void TestCleanup()
 {
     architectEntity = null;
 }