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