コード例 #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))
 {
 }