<commit_before>using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

namespace Mite.Tests
{
    [TestFixture]
    public class TimeEntryConverterTests
    {
        [Test]
        public void TimeEntry_Should_Be_Converted_From_Xml_String()
        {
            string input = @"<?xml version=""1.0"" encoding=""UTF-8""?>
                                <time-entry>
                                   <id type=""integer"">5</id>
                                   <date-at type=""date"">2009-2-12</date-at>
                                   <minutes type=""integer"">185</minutes>
                                   <revenue type=""float"" nil=""true""></revenue>
                                   <billable type=""boolean"">true</billable>
                                   <note></note>
                                   <user-id type=""integer"">2</user-id>
                                   <user-name><NAME></user-name>
                                   <project-id type=""integer"">3</project-id>
                                   <project-name>API 2.0</project-name>
                                   <service-id type=""integer"">2</service-id>
                                   <service-name>Dokumentation</service-name>
                                   <customer-id type=""integer"">13</customer-id>
                                   <customer-name>Knig</customer-name>
                                   <locked type=""boolean"">false</locked>
                                   <created-at type=""datetime"">2009-02-11T18:54:45+01:00</created-at>
                                   <updated-at type=""datetime"">2009-02-11T18:54:45+01:00</updated-at>
                                </time-entry>";

            var timeEntry = new TimeEntryConverter().Convert(input);

            Assert.That(timeEntry, Is.InstanceOfType(typeof (TimeEntry)));
        }
    }
}<commit_msg>Added test for conversion to XML<commit_after>using System;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

namespace Mite.Tests
{
    [TestFixture]
    public class TimeEntryConverterTests
    {
        [Test]
        public void TimeEntry_Should_Be_Converted_From_Xml_String()
        {
            string input = @"<?xml version=""1.0"" encoding=""UTF-8""?>
                                <time-entry>
                                   <id type=""integer"">5</id>
                                   <date-at type=""date"">2009-2-12</date-at>
                                   <minutes type=""integer"">185</minutes>
                                   <revenue type=""float"" nil=""true""></revenue>
                                   <billable type=""boolean"">true</billable>
                                   <note></note>
                                   <user-id type=""integer"">2</user-id>
                                   <user-name>Fridolin Fremd</user-name>
                                   <project-id type=""integer"">3</project-id>
                                   <project-name>API 2.0</project-name>
                                   <service-id type=""integer"">2</service-id>
                                   <service-name>Dokumentation</service-name>
                                   <customer-id type=""integer"">13</customer-id>
                                   <customer-name>Knig</customer-name>
                                   <locked type=""boolean"">false</locked>
                                   <created-at type=""datetime"">2009-02-11T18:54:45+01:00</created-at>
                                   <updated-at type=""datetime"">2009-02-11T18:54:45+01:00</updated-at>
                                </time-entry>";

            var timeEntry = new TimeEntryConverter().Convert(input);

            Assert.That(timeEntry, Is.InstanceOfType(typeof(TimeEntry)));
        }

        [Test]
        public void TimeEntry_Should_Be_Converted_Into_Xml_String()
        {
            //Todo create full test

            var timeEntry = new TimeEntry
            {
                Project = new Project { Id = 1 },
                CreatedOn = DateTime.UtcNow,
                Note = "Test",
                Revenue = 100,
                Minutes = 200
            };

            var result = new TimeEntryConverter().Convert(timeEntry);

            Assert.IsTrue(result.Contains("project-id"));
            Assert.IsTrue(result.Contains(@"<revenue>100</revenue>"));
            Assert.IsTrue(result.Contains(@"<minutes>200</minutes>"));
        }
    }
}
{'fraction_non_alphanumeric': 0.12895377128953772, 'fraction_numerical': 0.028091130280911304, 'mean_word_length': 1.2397226349678059, 'pattern_counts': {'":': 0, '<': 82, '<?xml version=': 2, '>': 82, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 34, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5622421', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1109, 'n_words': 157}