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

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

            result.Should().BeEmpty();
        }
Beispiel #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);
        }
Beispiel #3
0
 public void ParseCommaSeperatedListOfNames_InvalidEntry_ThrowsException()
 {
     Assert.Throws <ArgumentException>(() => EnumUtils.ParseCommaSeperatedListOfNames <Antibiotic>("Bacitracin, Blub, Amikacin"));
 }
Beispiel #4
0
 public AntibioticPriorityListComparer(string antibioticsOrder)
     : this(EnumUtils.ParseCommaSeperatedListOfNames <Antibiotic>(antibioticsOrder))
 {
 }