public void Undo_Should_insert_element_to_source_When_isAdd_is_false() { const int index = 42; object value = new(); IList <object> source = Substitute.For <IList <object> >(); IUnDo undo = new ListUnDo <object>(source, index, value, false); bool done = false; source.When(s => s.Insert(index, value)).Do(_ => done = true); undo.Undo(); Check.That(done).IsTrue(); }
public void Description_Should_return_description() { IUnDo undo = new ListUnDo <object>("test", Substitute.For <IList <object> >(), 0, null, true); Check.That(undo.Description).IsEqualTo("test"); }