private void AssertCompile <TSwitchValue>(Func <Func <string, Expression>, Expression, ParameterExpression, Expression> createExpression, Asserts <TSwitchValue> expected) { var res = WithLog <TSwitchValue>(createExpression).Compile(); foreach (var c in expected.Cases) { Assert.AreEqual(new LogAndResult <object>(c.Value, null, null), res(c.Key)); } if (expected.Null != null) { Assert.AreEqual(new LogAndResult <object>(expected.Null, null, null), res(default(TSwitchValue))); } }
public void ini() { asserts = new Asserts(); }