<commit_before>﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TextBox.Data;

namespace TextBox.Tests.Data
{
    [TestFixture]
    public class GlyphCompositeParentHandling
    {
        [Test]
        public void SetParentToTheCharaterIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph character = new Character();

            //act
            composition.Add(character);
            Glyph actualResult = character.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void SetParentToThePolygonIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph polygon = new Polygon();

            //act
            composition.Add(polygon);
            Glyph actualResult = polygon.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void SetParentToTheRectangleIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph rectangle = new Rectangle();

            //act
            composition.Add(rectangle);
            Glyph actualResult = rectangle.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void ChangeParentOfTheCharacterIfItIsRemovedFromComposition()<commit_msg>Few more unit tests added to support rows and columns.<commit_after>﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TextBox.Data;

namespace TextBox.Tests.Data
{
    [TestFixture]
    public class GlyphCompositeParentHandling
    {
        [Test]
        public void SetParentToTheCharaterIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph character = new Character();

            //act
            composition.Add(character);
            Glyph actualResult = character.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void SetParentToThePolygonIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph polygon = new Polygon();

            //act
            composition.Add(polygon);
            Glyph actualResult = polygon.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void SetParentToTheRectangleIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph rectangle = new Rectangle();

            //act
            composition.Add(rectangle);
            Glyph actualResult = rectangle.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void SetParentToTheRowIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph row = new Row();

            //act
            composition.Add(row);
            Glyph actualResult = row.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void SetParentToTheColumnIfItIsAddedToComposition()
        {
            //arrange
            Glyph composition = new Composition();
            Glyph column = new Column();

            //act
            composition.Add(column);
            Glyph actualResult = column.GetParent();

            //assert
            Glyph expectedResult = composition;
            Assert.AreSame(expectedResult, actualResult);
        }

        [Test]
        public void ChangeParentOfTheCharacterIfItIsRemovedFromComposition()
{'fraction_non_alphanumeric': 0.07735176103432902, 'fraction_numerical': 0.0, 'mean_word_length': 1.813166144200627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2361860', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1061, 'n_words': 248}