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); }
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."; }
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); }