public void StringMatchesLightningParserTest() { const string data = "Rails for Python Developers lightning"; var exp = new LightningParser(); var result = exp.Time(data); var wrongparser = new MinuteParser(); var wrongResult = wrongparser.Time(data); Assert.IsFalse(wrongparser.Success); Assert.AreEqual(0, wrongResult.TotalMinutes); Assert.IsTrue(exp.Success); Assert.AreEqual(5, result.TotalMinutes); }
public void StringMatchesGetMinutesParseTest() { const string data = "Writing Fast Tests Against Enterprise Rails 45min"; var exp = new MinuteParser(); var result = exp.Time(data); var wrongparser = new LightningParser(); var wrongResult = wrongparser.Time(data); Assert.IsFalse(wrongparser.Success); Assert.AreEqual(0, wrongResult.TotalMinutes); Assert.IsTrue(exp.Success); Assert.AreEqual(45, result.TotalMinutes); }