public void Parse_Rainy_Tests(string args, string err) { var a = new NoteArguments(args.Split(';'), new List<ArgInfo>()); var note = new Notification(); var parsed = a.Parse(note); Check.That(note.HasErrors).IsTrue(); Check.That(note.Errors.Count()).IsEqualTo(1); Check.That(note.Errors.First()).IsEqualTo(err); }
public void Parse_Happy_Tests(string args, string expected, int expectedCount) { var a = new NoteArguments(args.Split(';'), new List<ArgInfo>()); var note = new Notification(); var parsed = a.Parse(note); var expectedParsed = expected.Split(';').Select(x => x.Split('=')); Check.That(parsed.Count()).IsEqualTo(expectedCount); for (var i = 0; i < parsed.Count(); i++) { Check.That(parsed.ElementAt(i)).ContainsExactly(expectedParsed.ElementAt(i)); } Check.That(note.IsValid).IsTrue(); }