<commit_before>﻿using System.Collections.Generic;
using MSG.DomainLogic;
using NUnit.Framework;

namespace MSG.UnitTests
{
    [TestFixture]
    class GrowthTests
    {
        // Verify various combinations from GetGrowth.

        private List<int> _defaults;

        [SetUp]
        public void SetUpDefaultNumbers()
        {
            //_defaults = new List<int> {10, 55, 1, 74, 2, 4, 22, 2, 5, 1, 25, 28, 5, 15, 10, 6, 6, 1, 2, 3, 4};
            _defaults = new List<int> { 10, 55, 1, 74, 22, 2, 5, 1, 25, 28, 5, 15, 10, 6, 6, 1, 2, 3, 4 };
        }

        [TearDown]
        public void UndoRandomNumberSetting()
        {
            MoqUtil.UndoMockRandomNumber();
        }

        [Test]
        public void VerifyExceptionThrownForInvalidValue()
        {
            
        }

        [Test]
        public void VerifyOrganicGrowth()
        {
            _defaults.Insert(4, 1);
            _defaults.Insert(5, 1);

            MoqUtil.SetupRandMock(_defaults.ToArray());

            string output = DomainFactory.Generator.GetSentences(1)[0];

            Assert.AreEqual("An organic growth credibly accelerates strong mobile strategies at the end of the day.", output);
        }<commit_msg>Added a couple of tests for exception handling.<commit_after>﻿using System.Collections.Generic;
using MSG.DomainLogic;
using NUnit.Framework;

namespace MSG.UnitTests
{
    [TestFixture]
    class GrowthTests
    {
        // Verify various combinations from GetGrowth.

        private List<int> _defaults;

        [SetUp]
        public void SetUpDefaultNumbers()
        {
            //_defaults = new List<int> {10, 55, 1, 74, 2, 4, 22, 2, 5, 1, 25, 28, 5, 15, 10, 6, 6, 1, 2, 3, 4};
            _defaults = new List<int> { 10, 55, 1, 74, 22, 2, 5, 1, 25, 28, 5, 15, 10, 6, 6, 1, 2, 3, 4 };
        }

        [TearDown]
        public void UndoRandomNumberSetting()
        {
            MoqUtil.UndoMockRandomNumber();
        }

        [Test]
        public void VerifyExceptionThrownForInvalidSuperlative()
        {
            _defaults.Insert(4, 123);
            _defaults.Insert(5, 1);

            MoqUtil.SetupRandMock(_defaults.ToArray());

            Assert.Throws<RandomNumberException>(() => DomainFactory.Generator.GetSentences(1));
        }

        [Test]
        public void VerifyExceptionThrownForInvalidImprovement()
        {
            _defaults.Insert(4, 1);
            _defaults.Insert(5, 123);

            MoqUtil.SetupRandMock(_defaults.ToArray());

            Assert.Throws<RandomNumberException>(() => DomainFactory.Generator.GetSentences(1));
        }

        [Test]
        public void VerifyOrganicGrowth()
        {
            _defaults.Insert(4, 1);
            _defaults.Insert(5, 1);

            MoqUtil.SetupRandMock(_defaults.ToArray());

            string output = DomainFactory.Generator.GetSentences(1)[0];

            Assert.AreEqual("An organic growth credibly accelerates strong mobile strategies at the end of the day.", output);
        }
{'fraction_non_alphanumeric': 0.11217736598279285, 'fraction_numerical': 0.045665122435473195, 'mean_word_length': 2.0504540867810293, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '6591332', 'n_tokens_mistral': 1042, 'n_tokens_neox': 888, 'n_words': 235}