示例#1
0
        [Test] public void MultiTypeTest()
        {
            MockAction contactAction = new MockAction("Person");

            _composite.AddComponent("Person", contactAction, null);
            MockAction emailAction = new MockAction("Email");

            _composite.AddComponent("Email", emailAction, null);

            IResourceList resList = _storage.GetAllResources("Email").Union(
                _storage.GetAllResources("Person"));
            ActionContext      context      = new ActionContext(resList);
            ActionPresentation presentation = new ActionPresentation();

            _composite.Update(context, ref presentation);
            Assert.IsTrue(presentation.Visible);

            _composite.Execute(context);
            Assert.IsTrue(contactAction._executed);
            Assert.IsTrue(emailAction._executed);
        }