Ejemplo n.º 1
0
 private static void AssertAllInsuranceTypesArePresent(Domain.Enums.InsuranceTypes expected, List <Domain.Enums.InsuranceTypes> selectedInsuranceTypes)
 {
     foreach (var val in selectedInsuranceTypes)
     {
         Assert.IsTrue((expected & val) != 0);
     }
 }
Ejemplo n.º 2
0
        private static ICollection <InsuranceTypes> SplitIntoList(Domain.Enums.InsuranceTypes insuranceTypesFlags)
        {
            var split = InsuranceTypesListToFlagsConverter.SplitIntoList(insuranceTypesFlags);

            split.Remove(Domain.Enums.InsuranceTypes.Unspecified);

            return(split);
        }
        public static ICollection <InsuranceTypes> SplitIntoList(Domain.Enums.InsuranceTypes value)
        {
            var split = new List <InsuranceTypes>();

            foreach (var item in EnumHelper.GetAllAsCollection <List <InsuranceTypes>, InsuranceTypes>())
            {
                if (item == InsuranceTypes.Unspecified)
                {
                    continue;
                }

                if ((value & item) == item)
                {
                    split.Add(item);
                }
            }

            return(split);
        }