public void TestCtor() { Should.Throw <ArgumentNullException> (() => new StringMatchOperation(null), "a1"); Should.Throw <ArgumentException> (() => new StringMatchOperation(String.Empty), "a2"); var op = new StringMatchOperation("foo"); Assert.AreEqual("foo", op.String, "a3"); }
public void MatchNotAtStartShouldFail() { var op = new StringMatchOperation("oobar"); var data = new DataDictionary(); int end; bool m = op.IsMatch("foobar", 0, out data, out end); Assert.IsFalse(m, "a1"); Assert.IsNull(data, "a2"); Assert.AreEqual(0, end, "a3"); }
public void MatchFullStringTest() { var op = new StringMatchOperation("foobar"); var data = new DataDictionary(); int end; bool m = op.IsMatch("foobar", 0, out data, out end); Assert.IsTrue(m, "a1"); Assert.IsNull(data, "a2"); Assert.AreEqual(6, end, "a3"); }
public void TestStringProperty() { var op = new StringMatchOperation("foo"); Assert.AreEqual("foo", op.String, "a1"); Should.Throw <ArgumentNullException> (() => op.String = null, "a2"); Should.Throw <ArgumentException> (() => op.String = String.Empty, "a3"); op.String = "baz"; Assert.AreEqual("baz", op.String); }
public void TestCtor() { Should.Throw<ArgumentNullException>(() => new StringMatchOperation(null), "a1"); Should.Throw<ArgumentException>(() => new StringMatchOperation(String.Empty), "a2"); var op = new StringMatchOperation("foo"); Assert.AreEqual("foo", op.String, "a3"); }
public void TestStringProperty() { var op = new StringMatchOperation("foo"); Assert.AreEqual("foo", op.String, "a1"); Should.Throw<ArgumentNullException>(() => op.String = null, "a2"); Should.Throw<ArgumentException>(() => op.String = String.Empty, "a3"); op.String = "baz"; Assert.AreEqual("baz", op.String); }