Ejemplo n.º 1
0
        public void AddGroup()
        {
            var res = controller.AddGroup(3, 2);

            Assert.IsInstanceOfType(res, typeof(RedirectToRouteResult));
            var redirectRes = res as RedirectToRouteResult;

            Assert.AreEqual("Assign", redirectRes.RouteValues["action"]);
            Assert.AreEqual(3, redirectRes.RouteValues["id"]);

            mockRepository.Verify(r => r.Update(tests[2]));
            mockRepository.Verify(r => r.Save());
            var collection = tests[2].Groups as ICollection;

            CollectionAssert.Contains(collection, groups[1]);
        }