public void CountsByLocationAndProviderOrgUnit() { var location = CreateOrgUnit(1); var providerList = new List<ProviderCacheView>(); var provider1 = CreateProvider(1); providerList.AddRange(provider1.AddOrgUnit(location).AddInsurance(_insurance1).AddInsurance(_insurance2)); var builder = new InsuranceFilterBuilder(); var filter = builder.CreateFilters(providerList.AsQueryable()).FirstOrDefault(); Assert.IsNotNull(filter); Assert.AreEqual(2, filter.FilterValues.Count()); var filterValue0 = filter.FilterValues.ElementAt(0); Assert.AreEqual(1, filterValue0.Count); Assert.AreEqual(_insurance1.Name, filterValue0.DisplayName); Assert.AreEqual(_insurance1.Id.ToString(CultureInfo.InvariantCulture), filterValue0.QueryStringParameterValue); var filterValue1 = filter.FilterValues.ElementAt(1); Assert.AreEqual(1, filterValue1.Count); Assert.AreEqual(_insurance2.Name, filterValue1.DisplayName); Assert.AreEqual(_insurance2.Id.ToString(CultureInfo.InvariantCulture), filterValue1.QueryStringParameterValue); }
public void CreatesBasicFilter() { var providerList = new List<ProviderCacheView>(); var builder = new InsuranceFilterBuilder(); var filter = builder.CreateFilters(providerList.AsQueryable()).FirstOrDefault(); Assert.IsNotNull(filter); Assert.IsFalse(filter.SupportsMultipleValues); Assert.AreEqual("Insurance", filter.Name); Assert.AreEqual(QueryStringKeys.InsuranceIdKey, filter.QueryStringParameterName); Assert.IsNotNull(filter.FilterValues); Assert.AreEqual(0, filter.FilterValues.Count()); }