コード例 #1
0
 public void RenderMessage_ValueIsString_QuotedValueRendered()
 {
     var subj = new Variable("myvar", "myvalue");
     var renderedMessage = subj.RenderMessage("dataLayer");
     Assert.That(renderedMessage, Is.StringContaining("{'myvar': 'myvalue'}"));
 }
コード例 #2
0
 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}"));
 }
コード例 #3
0
 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'}}"));
 }
コード例 #4
0
 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']}"));
 }