using skyscraper5.Mpeg2;
using skyscraper5.Skyscraper.Scraper;
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
using skyscraper8.Tests.Properties;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper8.Tests
{
	public class TsDuckTestPatterns
	{
		[Fact]
		public void RunTestPatterns()
		{
			byte[][] buffers = new byte[][] { Resources.test_1packet_01, Resources.test_2packets_02_03, Resources.test_3packets_04_05_06 };

			InMemoryScraperStorageFactory imssf = new InMemoryScraperStorageFactory();

			foreach (byte[] buffer in buffers)
			{
				TsContext mpeg2 = new TsContext();
				SkyscraperContext skyscraper = new SkyscraperContext(mpeg2, null, null);
				MemoryStream ms = new MemoryStream(buffer, false);
				
				skyscraper.InitalizeFilterChain();
				skyscraper.IngestFromStream(ms);
				
				ms.Close();
				ms.Dispose();
			}
		}
	}
}
