public BusinessTripViewModel(BusinessTripEntity businessTripEntity)
 {
     StartingDate = businessTripEntity.StartingDate;
     EndingDate = businessTripEntity.EndingDate;
     Location = businessTripEntity.ClientLocation;
     Name = businessTripEntity.User.Name;
     MeansOfTransportaion = businessTripEntity.MeansOfTransportation;
     Accomodation = businessTripEntity.Accomodation;
     Status = businessTripEntity.Status;
     Id = businessTripEntity.Id;
 }
        public void Constructor_GivenABusinessTripEntity_InitializationSuccesful()
        {
            BusinessTripEntity businessTripEntity = new BusinessTripEntity()
            {
                StartingDate = DateTime.Now,
                ClientLocation = "Location",
                ClientName = "Name",
                MeansOfTransportation = "Car",
                Accomodation = "acc",
                Status = BusinessTripStatus.Accepted,
                Id = Guid.NewGuid(),
                User = new UserEntity() { Name = "Name"}
            };

            var businessTripViewModel = new BusinessTripViewModel(businessTripEntity);

            Assert.AreEqual(businessTripViewModel.StartingDate, businessTripEntity.StartingDate);
            Assert.AreEqual(businessTripViewModel.Location, businessTripEntity.ClientLocation);
            Assert.AreEqual(businessTripViewModel.Name, businessTripEntity.User.Name);
            Assert.AreEqual(businessTripViewModel.MeansOfTransportaion, businessTripEntity.MeansOfTransportation);
            Assert.AreEqual(businessTripViewModel.Accomodation, businessTripEntity.Accomodation);
            Assert.AreEqual(businessTripViewModel.Status, businessTripEntity.Status);
            Assert.AreEqual(businessTripViewModel.Id, businessTripEntity.Id);
        }
 public BusinessTripModel(BusinessTripEntity businessTripEntity)
 {
     FromEntity(businessTripEntity);
 }
 private void FromEntity(BusinessTripEntity businessTripEntity)
 {
     Id = businessTripEntity.Id;
     User = new UserModel(businessTripEntity.User);
     PmName = businessTripEntity.PmName;
     ProjectNumber = businessTripEntity.ProjectNumber;
     ProjectName = businessTripEntity.ProjectName;
     Accomodation = businessTripEntity.Accomodation;
     BankCardIsNeeded = businessTripEntity.BankCardIsNeeded;
     ClientLocation = businessTripEntity.ClientLocation;
     ClientName = businessTripEntity.ClientName;
     Area = businessTripEntity.Area;
     EndingDate = businessTripEntity.EndingDate;
     LeavingFrom = businessTripEntity.LeavingFrom;
     MeansOfTransportation = businessTripEntity.MeansOfTransportation;
     OtherInfo = businessTripEntity.OtherInfo;
     PhoneIsNeeded = businessTripEntity.PhoneIsNeeded;
     StartingDate = businessTripEntity.StartingDate;
     Status = businessTripEntity.Status;
     TaskName = businessTripEntity.TaskName;
     TaskNumber = businessTripEntity.TaskNumber;
 }