public void RenderMessage_ValueIsString_QuotedValueRendered() { var subj = new Variable("myvar", "myvalue"); var renderedMessage = subj.RenderMessage("dataLayer"); Assert.That(renderedMessage, Is.StringContaining("{'myvar': 'myvalue'}")); }
public void RenderMessage_ValueIsDecimal_ValueRendered() { var subj = new Variable("myvar", 12.34M); var renderedMessage = subj.RenderMessage("dataLayer"); Assert.That(renderedMessage, Is.StringContaining("{'myvar': 12.34}")); }
public void RenderMessage_ValueIsDictionary_ObjectRendered() { var subj = new Variable("myvar", new Dictionary<string, object> {{"key1", "val1"}}); var renderedMessage = subj.RenderMessage("dataLayer"); Assert.That(renderedMessage, Is.StringContaining("{'myvar': {'key1': 'val1'}}")); }
public void RenderMessage_ValueIsArray_ArrayRendered() { var subj = new Variable("myvar", new[] { "val1", "val2" }); var renderedMessage = subj.RenderMessage("dataLayer"); Assert.That(renderedMessage, Is.StringContaining("{'myvar': ['val1','val2']}")); }