Esempio n. 1
0
        public void throws_business_exception_when_removing_primary_location()
        {
            var subject = new Provider() { Id = 1 };
            var firstLocation = new OrgUnit() { Id = 1 };
            var secondLocation = new OrgUnit() { Id = 2 };
            subject.AddOrgUnit(firstLocation);
            subject.AddOrgUnit(secondLocation);

            subject.RemoveOrgUnit(firstLocation);
        }
Esempio n. 2
0
        public void can_remove_location()
        {
            var subject = new Provider() { Id = 1 };
            var firstLocation = new OrgUnit() { Id = 1 };
            var secondLocation = new OrgUnit() { Id = 2 };
            subject.AddOrgUnit(firstLocation);
            subject.AddOrgUnit(secondLocation);

            var removed = subject.RemoveOrgUnit(secondLocation);

            Assert.AreEqual(secondLocation, removed.OrgUnit);
            Assert.IsTrue(subject.ProviderOrgUnits.Count == 1);
        }