예제 #1
0
        public void ParseCommaSeperatedListOfNames_EmptyList_EmptyResult()
        {
            var commaSeperatedList = ", ";

            var result = EnumUtils.ParseCommaSeperatedListOfNames <Antibiotic>(commaSeperatedList);

            result.Should().BeEmpty();
        }
예제 #2
0
        public void ParseCommaSeperatedListOfNames_ValidList_ParsesCorrectly()
        {
            var commaSeperatedList = "Bacitracin, Amikacin";
            var expectedResult     = new List <Antibiotic> {
                Antibiotic.Bacitracin, Antibiotic.Amikacin
            };

            var result = EnumUtils.ParseCommaSeperatedListOfNames <Antibiotic>(commaSeperatedList);

            result.Should().ContainInOrder(expectedResult);
        }
예제 #3
0
 public void ParseCommaSeperatedListOfNames_InvalidEntry_ThrowsException()
 {
     Assert.Throws <ArgumentException>(() => EnumUtils.ParseCommaSeperatedListOfNames <Antibiotic>("Bacitracin, Blub, Amikacin"));
 }
예제 #4
0
 public AntibioticPriorityListComparer(string antibioticsOrder)
     : this(EnumUtils.ParseCommaSeperatedListOfNames <Antibiotic>(antibioticsOrder))
 {
 }