Ejemplo n.º 1
0
        public void AddActionsTest()
        {
            var collection = new ActionCollection <IActionTracingContainer>();

            collection.AddAction <DummyActionOne>();
            collection.AddAction(typeof(DummyActionTwo));

            Assert.True(collection.Count() == 2);
            Assert.Equal(typeof(DummyActionOne), collection.ElementAt(0).ActionType);
            Assert.Equal(typeof(DummyActionTwo), collection.ElementAt(1).ActionType);
        }
Ejemplo n.º 2
0
        public void InsertAction()
        {
            OctopusLib.Action newAction = new OctopusLib.Action
            {
                Name           = string.Format("New Action {0}", ActionCollection.Count() + 1),
                ActionCommands = new ObservableCollectionEx <OctopusLib.Command>(),
            };
            this.SelectedRow = newAction;
            newAction.ActionCommands.ItemPropertyChanged += PropertyChangedHandler;
            this.ActionCollection.Add(newAction);

            IsModified = true;
            Message    = "New action be added.";
        }
Ejemplo n.º 3
0
        public void AddActionsWithPriorityTest()
        {
            var collection = new ActionCollection <IActionTracingContainer>();

            collection.AddAction <DummyActionOne>(4);
            collection.AddAction(typeof(DummyActionTwo), 1);
            collection.AddAction(typeof(DummyActionThree), 3);
            collection.AddAction(typeof(DummyActionFour), 3);

            Assert.True(collection.Count() == 4);
            Assert.Equal(typeof(DummyActionTwo), collection.ElementAt(0).ActionType);
            Assert.Equal(typeof(DummyActionThree), collection.ElementAt(1).ActionType);
            Assert.Equal(typeof(DummyActionFour), collection.ElementAt(2).ActionType);
            Assert.Equal(typeof(DummyActionOne), collection.ElementAt(3).ActionType);
        }