Пример #1
0
        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();
        }
Пример #2
0
        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");
        }