﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArgumentHelper.Tests
{
	[TestClass]
    public class ConfigureTests
    {
		[TestMethod]
        public void ConfigureNoOptionTest()
		{
			var argumentHelper = new ArgumentHelper();
			Assert.ThrowsException<ArgumentException>(() => argumentHelper.Configure().Option());
		}

		[TestMethod]
		public void ConfigureNullOptionTest()
		{
			var argumentHelper = new ArgumentHelper();
			Assert.ThrowsException<ArgumentNullException>(() => argumentHelper.Configure().Option(null));
		}

		[TestMethod]
		public void ConfigureSingleOptionTest()
		{
			var argumentHelper = new ArgumentHelper();
			argumentHelper.Configure()
				.Option("-h");

			var option = argumentHelper.Configuration.Options.Single(o => o.Options.Contains("-h"));
			Assert.AreEqual(1, option.Options.Count);
			Assert.AreEqual("-h", option.Options[0]);
		}
	}
}
