﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CatchAllRouteTest.cs">
//   Copyright (c) 2015. All rights reserved.
//   Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
// <auto-generated>
//   Sourced from NuGet package. Will be overwritten with package update except in Spritely.Recipes source.
// </auto-generated>
// --------------------------------------------------------------------------------------------------------------------

namespace Spritely.Recipes.Mvc.Test
{
    using System;
    using NUnit.Framework;

    [TestFixture]
    public class CatchAllRouteTest
    {
        [Test]
        public void Constructor_throws_on_null_arguments()
        {
            Assert.Throws<ArgumentNullException>(() => new CatchAllRoute(null, "test"));
            Assert.Throws<ArgumentNullException>(() => new CatchAllRoute("test", null));
            Assert.Throws<ArgumentException>(() => new CatchAllRoute(" ", "test"));
            Assert.Throws<ArgumentException>(() => new CatchAllRoute("test", " "));
        }

        [Test]
        public void GetRouteData_returns_route_data_with_specified_controller_and_action()
        {
            var expectedController = "TestController";
            var expectedAction = "TestAction";
            var catchAllRoute = new CatchAllRoute(expectedController, expectedAction);

            var routeData = catchAllRoute.GetRouteData(null);

            Assert.That(routeData.Values.ContainsKey("controller"));
            Assert.That(routeData.Values["controller"], Is.EqualTo(expectedController));
            Assert.That(routeData.Values.ContainsKey("action"));
            Assert.That(routeData.Values["action"], Is.EqualTo(expectedAction));
        }
    }
}
