/// <summary> /// Добавление в память измененного значения элемента с указанием типа изменения /// </summary> /// <param name="component">Тип элемента</param> /// <param name="typeChanges">Тип действия</param> /// <param name="value">Значение</param> public void AddChangesValue <T_comp, T_val>(T_comp component, TypeChanges typeChanges, T_val value) { if (component is Resistor) { if (typeChanges == TypeChanges.Plus) { actions.Append("Сопротивление резистора было увеличено до " + Convert.ToString(value) + " Ом. "); } else if (typeChanges == TypeChanges.Minus) { actions.Append("Сопротивление резистора было уменьшено до " + Convert.ToString(value) + " Ом. "); } else { actions.Append("Сопротивление проводника было изменено до " + Convert.ToString(value) + " Ом. "); } } if (component is Toggle) { if (typeChanges == TypeChanges.On) { actions.Append("При помощи ключа цепь была замкнута. "); } else { actions.Append("При помощи ключа цепь была разомкнута. "); } } }
public void AddChangesValue <T_comp>(T_comp component, TypeChanges typeChanges) { if (component is Toggle) { if (typeChanges == TypeChanges.On) { actions.Append("При помощи ключа цепь была замкнута. "); } else { actions.Append("При помощи ключа цепь была разомкнута. "); } } }
static XElement Format(TypeChanges typeChangeSet) { var testCaseElement = new XElement("testcase", new XAttribute("name", typeChangeSet.Type != null ? typeChangeSet.Type.FullName : "<framework changes>")); var nonBreakingChanges = new List <Change>(); foreach (var change in typeChangeSet.Changes) { if (change.IsBreaking) { testCaseElement.Add(new XElement("failure", new XAttribute("type", "BreakingChange"), new XAttribute("message", change.Message))); } else { nonBreakingChanges.Add(change); } } if (nonBreakingChanges.Any()) { testCaseElement.Add(new XElement("system-out", string.Join("\n", nonBreakingChanges.Select(x => x.Message)))); } return(testCaseElement); }
public Changes(string word_or_text, TypeChanges type) { WordOrText = word_or_text; Type = type; }