<commit_before>﻿using ExcelReportsCreator.Tests.Utils;
using System;
using System.Collections.Generic;
using Xunit;

namespace ExcelReportsCreator.Tests.Reports
{
    public class ReportBuilderContentTests
    {
        [Fact]
        public void Build_AddColumn_ReturnsBinary()
        {
            var entities = TestUtils.CreateTestReportEntities(10);
            var binary = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_AddColumn_ReturnsBinary))
                .AddColumn(entity => new ReportColumn()
                {
                    Title = "Title",
                    Value = entity.Title
                })
                .Build(entities);

            Assert.NotNull(binary);
            Assert.NotEmpty(binary);
        }

        [Fact]
        public void Build_PutEmptyCollection_ReturnsNull()
        {
            var binary = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_PutEmptyCollection_ReturnsNull))
                .AddColumn(entity => new ReportColumn()
                {
                    Title = "Title",
                    Value = entity.Title
                })
                .Build(new List<TestReportEntity>());

            Assert.Null(binary);
        }

        [Fact]
        public void Build_PutNull_ReturnsNull()
        {
            var binary = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_PutEmptyCollection_ReturnsNull))
                .AddColumn(entity => new ReportColumn()
                {
                    Title = "Title",
                    Value = entity.Title
                })
                .Build(null);

            Assert.Null(binary);
        }

        [Theory]
        [InlineData(10)]
        [InlineData(100000)]
        public void Build_PutCollection_EqualsCount(int count)
        {
            var entities = TestUtils.CreateTestReportEntities(count);

            throw new NotImplementedException();
        }

        [Fact]
        public void Build_NoColumns_ThrowsReportBuilderException()
        {
            var entities = TestUtils.CreateTestReportEntities(10);
            var builder = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_AddColumn_ReturnsBinary));

            Assert.Throws<ReportBuilderException>(() => builder.Build(entities));
        }
    }
}<commit_msg>Removed redundant test for count check<commit_after>﻿using ExcelReportsCreator.Tests.Utils;
using System;
using System.Collections.Generic;
using Xunit;

namespace ExcelReportsCreator.Tests.Reports
{
    public class ReportBuilderContentTests
    {
        [Fact]
        public void Build_AddColumn_ReturnsBinary()
        {
            var entities = TestUtils.CreateTestReportEntities(10);
            var binary = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_AddColumn_ReturnsBinary))
                .AddColumn(entity => new ReportColumn()
                {
                    Title = "Title",
                    Value = entity.Title
                })
                .Build(entities);

            Assert.NotNull(binary);
            Assert.NotEmpty(binary);
        }

        [Fact]
        public void Build_PutEmptyCollection_ReturnsNull()
        {
            var binary = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_PutEmptyCollection_ReturnsNull))
                .AddColumn(entity => new ReportColumn()
                {
                    Title = "Title",
                    Value = entity.Title
                })
                .Build(new List<TestReportEntity>());

            Assert.Null(binary);
        }

        [Fact]
        public void Build_PutNull_ReturnsNull()
        {
            var binary = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_PutEmptyCollection_ReturnsNull))
                .AddColumn(entity => new ReportColumn()
                {
                    Title = "Title",
                    Value = entity.Title
                })
                .Build(null);

            Assert.Null(binary);
        }

        [Theory]
        [InlineData(10)]
        public void Build_PutCollection_EqualsCount(int count)
        {
            var entities = TestUtils.CreateTestReportEntities(count);

            throw new NotImplementedException();
        }

        [Fact]
        public void Build_NoColumns_ThrowsReportBuilderException()
        {
            var entities = TestUtils.CreateTestReportEntities(10);
            var builder = ReportBuilder<TestReportEntity>
                .Create(nameof(Build_AddColumn_ReturnsBinary));

            Assert.Throws<ReportBuilderException>(() => builder.Build(entities));
        }
    }
}
{'fraction_non_alphanumeric': 0.08266214497668503, 'fraction_numerical': 0.0038151759220008477, 'mean_word_length': 1.6585915492957746, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, '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': '3319584', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1110, 'n_words': 194}