<commit_before>﻿using System.IO;
using System.Linq;
using Project.GtfsNet.Entities;
using Project.GtfsNet.Parsers;
using Xunit;
using Xunit.Abstractions;

namespace Project.GtfsNet.Test.Tests.Parsers
{
	public class GtfsFeedVistorTest
	{
		private readonly ITestOutputHelper _output;
		private readonly GtfsFeedVisitor _sut;
		private const string FEED_PATH = "feeds/subway";

		public GtfsFeedVistorTest(ITestOutputHelper output)
		{
			_output = output;
			_sut = new GtfsFeedVisitor(FEED_PATH);
		}

		[Fact]
		public void ParserDoesntReturnEmptyGtfsFeedProperties()
		{
			GtfsFeed feed = new GtfsFeed();
			feed.Accept(_sut);

			Assert.NotNull(feed.Agencies);
			Assert.NotNull(feed.Calendars);
			Assert.NotNull(feed.CalendarDates);
			Assert.NotNull(feed.FareAttributes);
			Assert.NotNull(feed.FareRules);
			Assert.NotNull(feed.FeedInfos);
			Assert.NotNull(feed.Frequencies);
			Assert.NotNull(feed.Routes);
			Assert.NotNull(feed.Shapes);
			Assert.NotNull(feed.Stops);
			Assert.NotNull(feed.StopTimes);
			Assert.NotNull(feed.Transfers);
			Assert.NotNull(feed.Trips);
		}

		[Fact]
		public void ParserReturnParsedGtfsFeedWithAtLeastOneRecordInEachProperty()
		{
			GtfsFeed feed = new GtfsFeed();
			feed.Accept(_sut);

			_output.WriteLine("_sut.Feed.Count: {0}", _sut.Feed.Agencies.Count);
			Assert.NotEmpty(_sut.Feed.Agencies);

			_output.WriteLine("_sut.Feed.Count: {0}", _sut.Feed.Calendars.Count);
			Assert.NotEmpty(_sut.Feed.Calendars);

			_output.WriteLine("_sut.Feed.CalendarDates.Count: {0}", _sut.Feed.CalendarDates.Count);
			Assert.NotEmpty(_sut.Feed.CalendarDates);<commit_msg>Updated test.<commit_after>﻿using System.IO;
using System.Linq;
using Project.GtfsNet.Entities;
using Project.GtfsNet.Parsers;
using Xunit;
using Xunit.Abstractions;

namespace Project.GtfsNet.Test.Tests.Parsers
{
	public class GtfsFeedVistorTest
	{
		private readonly ITestOutputHelper _output;
		private readonly GtfsFeedVisitor _sut;
		private const string FEED_PATH = "feeds/subway";

		public GtfsFeedVistorTest(ITestOutputHelper output)
		{
			_output = output;
			_sut = new GtfsFeedVisitor(FEED_PATH);
		}

		[Fact]
		public void ParserDoesntReturnEmptyGtfsFeedProperties()
		{
			GtfsFeed feed = new GtfsFeed();
			feed.Accept(_sut);
			feed = _sut.Feed;

			Assert.NotNull(feed.Agencies);
			Assert.NotNull(feed.Calendars);
			Assert.NotNull(feed.CalendarDates);
			Assert.NotNull(feed.FareAttributes);
			Assert.NotNull(feed.FareRules);
			Assert.NotNull(feed.FeedInfos);
			Assert.NotNull(feed.Frequencies);
			Assert.NotNull(feed.Routes);
			Assert.NotNull(feed.Shapes);
			Assert.NotNull(feed.Stops);
			Assert.NotNull(feed.StopTimes);
			Assert.NotNull(feed.Transfers);
			Assert.NotNull(feed.Trips);
		}

		[Fact]
		public void ParserReturnParsedGtfsFeedWithAtLeastOneRecordInEachProperty()
		{
			GtfsFeed feed = new GtfsFeed();
			feed.Accept(_sut);

			_output.WriteLine("_sut.Feed.Count: {0}", _sut.Feed.Agencies.Count);
			Assert.NotEmpty(_sut.Feed.Agencies);

			_output.WriteLine("_sut.Feed.Count: {0}", _sut.Feed.Calendars.Count);
			Assert.NotEmpty(_sut.Feed.Calendars);

			_output.WriteLine("_sut.Feed.CalendarDates.Count: {0}", _sut.Feed.CalendarDates.Count);
			Assert.NotEmpty(_sut.Feed.CalendarDates);
{'fraction_non_alphanumeric': 0.12210915818686402, 'fraction_numerical': 0.0018501387604070306, 'mean_word_length': 4.8768115942028984, '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': '3874433', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1163, 'n_words': 164}