public void IndexHappyTest()
        {
            IEnumerable <Origin> expected = new List <Origin>
            {
                new Origin
                {
                    Id   = 1,
                    Name = "orgrimmar"
                },
                new Origin
                {
                    Id   = 2,
                    Name = "stormwind"
                }
            };

            var mockRepo = new Mock <IPlantBreedingRepo>();

            mockRepo.Setup(r => r.GetOrigins()).Returns(expected);

            var controller = new OriginsController(mockRepo.Object);
            var response   = controller.Index() as ViewResult;

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Model as IEnumerable <Origin>);

            var actual = response.Model as IEnumerable <Origin>;

            Assert.IsTrue(Enumerable.SequenceEqual(actual, expected));
        }
        public void NullIndexTest()
        {
            IEnumerable <Origin> expected = null;

            var mockRepo = new Mock <IPlantBreedingRepo>();

            mockRepo.Setup(r => r.GetOrigins()).Returns(expected);

            var controller = new OriginsController(mockRepo.Object);
            var response   = controller.Index() as RedirectToRouteResult;

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.RouteValues);
            Assert.AreEqual("Create", response.RouteValues["action"]);
        }