public void AddStep_NewOperation_CorrectAddingOfSteps( Dictionary <string, List <BaseStep> > addingStates, Dictionary <string, List <BaseStep> > expectedStates, BaseOperation customizableOper) { foreach (var state in addingStates.Keys) { foreach (var step in addingStates[state]) { customizableOper.AddStep(state, step.LuaName, step.Name, step.DefaultPosition); } } Assert.Multiple(() => { foreach (var state in customizableOper.States.Keys) { Assert.True(expectedStates.ContainsKey(state)); foreach (var step in customizableOper.States[state]) { Assert.True(expectedStates[state] .Where(x => x.Name == step.Name && x.LuaName == step.LuaName && x.DefaultPosition == step.DefaultPosition && x.Owner == step.Owner) .Count() == 1); } } }); }
private void FillBaseOperationStatesWithReset(BaseOperation oper, Dictionary <string, List <BaseStep> > addingStates) { oper.States.Clear(); foreach (var state in addingStates.Keys) { foreach (var step in addingStates[state]) { oper.AddStep(state, step.LuaName, step.Name, step.DefaultPosition); } } }