public void Parse() { var expectedGuidelines = new GuidelineCollection(new[] { new Guideline(1.5, GuidelineColor.Green), new Guideline(3.2, GuidelineColor.Yellow), new Guideline(4.7, GuidelineColor.Orange), new Guideline(6.0, GuidelineColor.Green), new Guideline(7.25, GuidelineColor.Green), new Guideline(8.112, GuidelineColor.Yellow), }); var resultingGuidelines = GuidelineCollection.Parse(guidelineString); Assert.AreEqual(expectedGuidelines, resultingGuidelines); resultingGuidelines = GuidelineCollection.Parse($"{guidelineString}~"); Assert.AreEqual(expectedGuidelines, resultingGuidelines); resultingGuidelines = GuidelineCollection.Parse($"~"); Assert.AreEqual(Array.Empty <Guideline>(), resultingGuidelines); resultingGuidelines = GuidelineCollection.Parse($""); Assert.AreEqual(Array.Empty <Guideline>(), resultingGuidelines); }
public void Parse() { var matchedGuidelines = new Guideline[] { new Guideline(1.5, GuidelineColor.Green), new Guideline(3.2, GuidelineColor.Yellow), new Guideline(4.7, GuidelineColor.Orange), new Guideline(6.0, GuidelineColor.Green), new Guideline(7.25, GuidelineColor.Green), new Guideline(8.112, GuidelineColor.Yellow), }; var collection = GuidelineCollection.Parse("1.5~1~3.2~0.9~4.7~0.8~6~1~7.25~1~8.112~0.9"); for (int i = 0; i < matchedGuidelines.Length; i++) { Assert.IsTrue(collection[i] == matchedGuidelines[i]); } }