Exemple #1
0
        public MedicalVendor GetMedicalVendor(long medicalVendorId)
        {
            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var            medicalVendorProfileEntity = new MedicalVendorProfileEntity(medicalVendorId);
                IPrefetchPath2 path = new PrefetchPath2(EntityType.MedicalVendorProfileEntity);
                path.Add(MedicalVendorProfileEntity.PrefetchPathOrganization);

                if (!myAdapter.FetchEntity(medicalVendorProfileEntity, path))
                {
                    throw new ObjectNotFoundInPersistenceException <MedicalVendor>(medicalVendorId);
                }
                var medicalVendor = _medicalVendorFactory.CreateMedicalVendor(medicalVendorProfileEntity);
                return(medicalVendor);
            }
        }
        public void CreateMedicalVendor_ReturnsAvaildDomainObject()
        {
            _medicalVendorFactory = IoC.Resolve <IMedicalVendorFactory>();
            var medicalVendorProfile = new MedicalVendorProfileEntity
            {
                ContractId        = 2,
                TypeId            = 1,
                IsHospitalPartner = false,
                Organization      = new OrganizationEntity {
                    Name = "Medical Vendor One",
                }
            };

            var actualMedicalVendor = _medicalVendorFactory.CreateMedicalVendor(medicalVendorProfile);

            Assert.AreEqual("Medical Vendor One", actualMedicalVendor.Name);
        }