<commit_before>﻿using Moq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;

namespace RSG.MetricsTests
{
    public class MetricsTests
    {
        Metrics testObject;

        Mock<IMetricsEmitter> mockMetricsEmitter;

        void Init()
        {
            mockMetricsEmitter = new Mock<IMetricsEmitter>();

            testObject = new Metrics(mockMetricsEmitter.Object);
        }

        [Fact]
        public void entry_with_string_emits_message()
        {
            Init();

            testObject.Entry("TestEntry", "Testing");

            mockMetricsEmitter
                .Verify(m => m.Emit(It.IsAny<Dictionary<string, string>>(), It.IsAny<IMetric[]>()), Times.Once());
        }

        [Fact]
        public void entry_with_string_contains_entry_name()
        {
            Init();

            var name = "TestEntry";

            string emittedEntryName = String.Empty;

            mockMetricsEmitter
                .Setup(m => m.Emit(It.IsAny<Dictionary<string, string>>(), It.IsAny<IMetric[]>()))
                .Callback<Dictionary<string, string>, IMetric[]>((properties, metrics) => {
                    var entry = (Metric<string>) metrics[0];
                    emittedEntryName = entry.Name;
                });

            testObject.Entry(name, "Test content");

            Assert.Equal(name, emittedEntryName);
        }

        [Fact]
        public void entry_with_string_contains_string()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_includes_property_on_first_message()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_sets_property_string()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_sets_property_name()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_includes_property_on_subsequent_messages()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_updates_existing_property()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void remove_property_stops_including_properties_on_messages()
        {
            throw new NotImplementedException();
        }
    }
}
<commit_msg>Added test that entry contains string content<commit_after>﻿using Moq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;

namespace RSG.MetricsTests
{
    public class MetricsTests
    {
        Metrics testObject;

        Mock<IMetricsEmitter> mockMetricsEmitter;

        void Init()
        {
            mockMetricsEmitter = new Mock<IMetricsEmitter>();

            testObject = new Metrics(mockMetricsEmitter.Object);
        }

        [Fact]
        public void entry_with_string_emits_message()
        {
            Init();

            testObject.Entry("TestEntry", "Testing");

            mockMetricsEmitter
                .Verify(m => m.Emit(It.IsAny<Dictionary<string, string>>(), It.IsAny<IMetric[]>()), Times.Once());
        }

        [Fact]
        public void entry_with_string_contains_entry_name()
        {
            Init();

            const string name = "TestEntry";

            string emittedEntryName = String.Empty;

            mockMetricsEmitter
                .Setup(m => m.Emit(It.IsAny<Dictionary<string, string>>(), It.IsAny<IMetric[]>()))
                .Callback<Dictionary<string, string>, IMetric[]>((properties, metrics) => {
                    var entry = (Metric<string>) metrics[0];
                    emittedEntryName = entry.Name;
                });

            testObject.Entry(name, "Test content");

            Assert.Equal(name, emittedEntryName);
        }

        [Fact]
        public void entry_with_string_contains_string()
        {
            Init();

            const string content = "Test content";

            string emittedContent = String.Empty;

            mockMetricsEmitter
                .Setup(m => m.Emit(It.IsAny<Dictionary<string, string>>(), It.IsAny<IMetric[]>()))
                .Callback<Dictionary<string, string>, IMetric[]>((properties, metrics) => {
                    var entry = (Metric<string>) metrics[0];
                    emittedContent = entry.Content;
                });

            testObject.Entry("TestEntry", content);

            Assert.Equal(content, emittedContent);
        }

        [Fact]
        public void set_property_includes_property_on_first_message()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_sets_property_string()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_sets_property_name()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_includes_property_on_subsequent_messages()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void set_property_updates_existing_property()
        {
            throw new NotImplementedException();
        }

        [Fact]
        public void remove_property_stops_including_properties_on_messages()
        {
            throw new NotImplementedException();
        }
    }
}

{'fraction_non_alphanumeric': 0.09620938628158844, 'fraction_numerical': 0.0005415162454873646, 'mean_word_length': 1.887441375716519, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6572745', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1414, 'n_words': 276}