Esempio n. 1
0
        public void GroupsDelete()
        {
            Mock <Storage> storage = new Mock <Storage>();

            storage.Setup(o => o.GetGroups()).Returns(groups);

            Groups gr = groups.First();

            storage.Setup(o => o.DeleteGroup(gr)).Callback(() => groups.Remove(gr));
            groupsController.Storage = storage.Object;

            ActionResult result = (groupsController.FilterGroups(new GroupsList {
                CurrentGroup = gr
            }, "Delete"));

            Assert.AreEqual(4, groups.Count);
        }