Example #1
0
        public void NullTagValueShouldNotCreateAttributes()
        {
            var tag = new KeyValuePair <string, object>("foo", null);

            var attributes = tag.GetAttributes();

            CollectionAssert.IsEmpty(attributes);
        }
Example #2
0
        public void EmptyResponseStatusShouldNotCreateAttributes()
        {
            var tag = new KeyValuePair <string, object>("response.status", "");

            var attributes = tag.GetAttributes();

            CollectionAssert.IsEmpty(attributes);
        }
Example #3
0
        public void TagShouldCreateSingleAttribute()
        {
            var tag = new KeyValuePair <string, object>("foo", "bar");

            var attributes = tag.GetAttributes();

            var expectedAttributes = new[] { new KeyValuePair <string, object>("foo", "bar") };

            CollectionAssert.AreEquivalent(expectedAttributes, attributes);
        }
Example #4
0
        public void HttpStatusCodeTagShouldCreateAppropriateAttributes()
        {
            var tag = new KeyValuePair <string, object>("http.status_code", 200);

            var attributes = tag.GetAttributes();

            var expectedAttributes = new[] { new KeyValuePair <string, object>("response.status", "200"), new KeyValuePair <string, object>("http.statusCode", 200) };

            CollectionAssert.AreEquivalent(expectedAttributes, attributes);
        }
Example #5
0
        public void NonNumericResponseStatusTagShouldNotCreateHttpStatusCodeAttribute()
        {
            var tag = new KeyValuePair <string, object>("response.status", "foo");

            var attributes = tag.GetAttributes();

            var expectedAttributes = new[] { new KeyValuePair <string, object>("response.status", "foo") };

            CollectionAssert.AreEquivalent(expectedAttributes, attributes);
        }