public void throws_business_exception_when_blank_year_specified()
        {
            //setup
            var provider = CreateProvider();
            var certificationSpecialty = CreateCertificationSpecialty();
            string year = string.Empty;

            //act
            var providerCertificationSpecialty = new ProviderCertificationSpecialty(provider, certificationSpecialty, year);
        }
Example #2
0
        /// <summary>
        /// Adds the provider certification specialty.
        /// </summary>
        /// <param name="certificationSpecialty">The certification specialty.</param>
        /// <param name="yearOfIssuance">The year the cerficiation was issued.</param>
        public ProviderCertificationSpecialty AddCertificationSpecialty(CertificationSpecialty certificationSpecialty, string yearOfIssuance)
        {
            if (certificationSpecialty == null)
            {
                throw new ArgumentNullException("certificationSpecialty");
            }
            if (String.IsNullOrEmpty(yearOfIssuance))
            {
                throw new ArgumentNullException("yearOfIssuance");
            }
            if (ProviderCertificationSpecialties.Count(pl => pl.CertificationSpecialtyId.Equals(certificationSpecialty.Id)) > 0)
            {
                throw new BusinessException("The specialty is already associated with this provider");
            }

            var providerCertificationSpecialty = new ProviderCertificationSpecialty(this, certificationSpecialty, yearOfIssuance);

            ProviderCertificationSpecialties.Add(providerCertificationSpecialty);

            return providerCertificationSpecialty;
        }
        public void throws_exception_when_no_provider_specified()
        {
            //setup
            Provider provider = null;
            var CertificationSpecialty = CreateCertificationSpecialty();

            //act
            var providerCertificationSpecialty = new ProviderCertificationSpecialty(provider, CertificationSpecialty, _validYear);
        }
        public void throws_exception_when_no_CertificationSpecialty_specified()
        {
            //setup
            var provider = CreateProvider();
            CertificationSpecialty CertificationSpecialty = null;

            //act
            var providerCertificationSpecialty = new ProviderCertificationSpecialty(provider, CertificationSpecialty, _validYear);
        }