You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've written a test to replicate this problem - this would be really useful functionality for us.
/// <summary>
/// Testing with Dynamic object.
/// </summary>
[TestMethod]
public void TestCompile_DynamicObject_RendersCorrectly() {
FormatCompiler compiler = new FormatCompiler();
const string format = @"Hello {{Name}}";
Generator generator = compiler.Compile(format);
dynamic obj = new TestDymnamic();
Assert.AreEqual("Paul", obj.Name);
string actual = generator.Render(obj);
string expected = "Hello Paul";
Assert.AreEqual(expected, actual, "The number was not passed to the formatter.");
}
private class TestDymnamic: DynamicObject {
public override bool TryGetMember(GetMemberBinder binder, out object result) {
result = "Paul";
return true;
}
}
The text was updated successfully, but these errors were encountered:
I've written a test to replicate this problem - this would be really useful functionality for us.
The text was updated successfully, but these errors were encountered: