コード例 #1
0
ファイル: TestProvider.cs プロジェクト: rickeygalloway/Test
        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);
        }
コード例 #2
0
ファイル: TestProvider.cs プロジェクト: rickeygalloway/Test
        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);
        }