示例#1
0
        public void TestCommonA(TestCommonATestCase testCase)
        {
            var parser = new IngredientItemParserCommonA();
            var result = parser.Parse(testCase.Input);

            Assert.That(result.Candidates, Has.Count.EqualTo(testCase.ExpectedCount));
            for (var i = 0; i < result.Candidates.Count(); i++)
            {
                Assert.That(result.Candidates.ElementAt(i).Name, Is.EqualTo(testCase.Expected[i].Name), "Ingredient name did not match.");
                Assert.That(result.Candidates.ElementAt(i).Amount, Is.EqualTo(testCase.Expected[i].Amount), "Ingredient amount did not match.");
                Assert.That(result.Candidates.ElementAt(i).Unit, Is.EqualTo(testCase.Expected[i].Unit), "Ingredient unit did not match");
                Assert.That(result.Candidates.ElementAt(i).Note, Is.EqualTo(testCase.Expected[i].Note), "Ingredient note did not match");
            }
        }
示例#2
0
 public void TestCommonARandom(TestCommonATestCase testCase)
 => TestCommonA(testCase);
示例#3
0
 public void TestCommonAAmount(TestCommonATestCase testCase)
 => TestCommonA(testCase);
示例#4
0
 public void TestCommonAUnit(TestCommonATestCase testCase)
 => TestCommonA(testCase);