public void lists_custom_and_inherited_insurances_after_custom_insurances_are_added()
        {
            //setup
            HandleRequest<AddProviderOrgUnitInsuranceResponse>(new AddProviderOrgUnitInsuranceHandler
            {
                ObjectContextFactory = _objectContextFactory
            }, new AddProviderOrgUnitInsuranceRequest
            {
                InsuranceId = _idOfInsurance,
                ProviderOrgUnitId = _idOfProviderOrgUnitWith0AcceptedInsurance
            });

            //act
            var request = new ListProviderOrgUnitInsurancesRequest
            {
                ProviderOrgUnitId = _idOfProviderOrgUnitWith0AcceptedInsurance
            };

            var response = HandleRequest<ListProviderOrgUnitInsurancesResponse>(CreateHandler(), request);

            //assert
            Assert.AreEqual(2, response.Insurances.Count());
            Assert.IsTrue(response.Insurances.Where(x => x.IsInherited).Count() == 1);
            Assert.IsTrue(response.Insurances.Where(x => !x.IsInherited).Count() == 1);
        }
        public void lists_all_accepted_insurances_of_provider_location()
        {
            //setup
            var request = new ListProviderOrgUnitInsurancesRequest();
            request.ProviderOrgUnitId = _idOfProviderOrgUnitWith1AcceptedInsurance;

            //act
            var response = HandleRequest<ListProviderOrgUnitInsurancesResponse>(CreateHandler(), request);

            //assert
            Assert.AreEqual(1, response.Insurances.Count());
        }
        public void lists_inherited_insurances_by_default()
        {
            //setup
            var request = new ListProviderOrgUnitInsurancesRequest
                          {
                              ProviderOrgUnitId = _idOfProviderOrgUnitWith0AcceptedInsurance
                          };

            //act
            var response = HandleRequest<ListProviderOrgUnitInsurancesResponse>(CreateHandler(), request);

            //assert
            Assert.AreEqual(1, response.Insurances.Count());
            Assert.AreEqual(4, response.Insurances.First().InsuranceId);
            Assert.IsTrue(response.Insurances.First().IsInherited);
        }