Exemplo n.º 1
0
 public void appends_primary_specialty()
 {
     var provider = new Provider();
     provider.SetName("", "Test", "", "Provider", "","");
     provider.AddSpecialty(new Specialty() { Name = "Cardiology" });
     var result = GenerateDirectUrl(provider);
     Assert.AreEqual("test-provider-cardiology", result.ToString());
 }
Exemplo n.º 2
0
 public void can_add_specialty()
 {
     var subject = new Provider() { Id = 1 };
     var specialty = new Specialty() { Id = 1 };
     var providerSpecialty = subject.AddSpecialty(specialty);
     Assert.IsNotNull(providerSpecialty);
     Assert.AreSame(specialty, providerSpecialty.Specialty);
     Assert.AreSame(subject, providerSpecialty.Provider);
 }
Exemplo n.º 3
0
        public void can_change_primary_specialty()
        {
            var subject = new Provider() { Id = 1 };
            var specialtyA = new Specialty() { Id = 1 };
            var providerSpecialtyA = subject.AddSpecialty(specialtyA);

            var specialtyB = new Specialty() { Id = 2 };
            var providerSpecialtyB = subject.AddSpecialty(specialtyB);

            subject.SetPrimarySpecialty(providerSpecialtyB);

            Assert.IsFalse(providerSpecialtyA.IsPrimary);
            Assert.IsTrue(providerSpecialtyB.IsPrimary);
        }
Exemplo n.º 4
0
 public void throws_exception_when_adding_null_specialty()
 {
     var subject = new Provider();
     subject.AddSpecialty(null);
 }
Exemplo n.º 5
0
        public void throws_business_exception_when_removing_primary_specialty()
        {
            var subject = new Provider() { Id = 1 };
            var firstSpecialty = new Specialty() { Id = 1 };
            var secondSpecialty = new Specialty() { Id = 2 };
            subject.AddSpecialty(firstSpecialty);
            subject.AddSpecialty(secondSpecialty);

            subject.RemoveSpecialty(firstSpecialty);
        }
Exemplo n.º 6
0
 public void throws_business_exception_when_adding_existing_specialty()
 {
     var subject = new Provider() { Id = 1 };
     var specialty = new Specialty() { Id = 1 };
     subject.AddSpecialty(specialty);
     subject.AddSpecialty(specialty);
 }
Exemplo n.º 7
0
 public void makes_first_specialty_primary()
 {
     var subject = new Provider() { Id = 1 };
     var specialty = new Specialty() { Id = 1 };
     var providerSpecialty = subject.AddSpecialty(specialty);
     Assert.IsTrue(providerSpecialty.IsPrimary);
 }
Exemplo n.º 8
0
        public void keeps_primary_specialty_when_adding_new_specialty()
        {
            var subject = new Provider() { Id = 1 };
            var specialtyA = new Specialty() { Id = 1 };
            var providerSpecialtyA = subject.AddSpecialty(specialtyA);

            var specialtyB = new Specialty() { Id = 2 };
            var providerSpecialtyB = subject.AddSpecialty(specialtyB);

            Assert.IsTrue(providerSpecialtyA.IsPrimary);
        }
Exemplo n.º 9
0
        public void can_remove_specialty()
        {
            var subject = new Provider() { Id = 1 };
            var firstSpecialty = new Specialty() { Id = 1 };
            var secondSpecialty = new Specialty() { Id = 2 };
            subject.AddSpecialty(firstSpecialty);
            subject.AddSpecialty(secondSpecialty);

            var removed = subject.RemoveSpecialty(secondSpecialty);

            Assert.AreEqual(secondSpecialty, removed.Specialty);
            Assert.IsTrue(subject.ProviderSpecialties.Count == 1);
        }