public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; HistoryStack = new LimitedSizeStack <ICommand>(Limit); CommandBuilder = new CommandBuilder <TItem>(this); }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; _historyItems = new LimitedSizeStack <TItem>(limit); _historyIndex = new LimitedSizeStack <int>(limit); _historyOperations = new LimitedSizeStack <char>(limit); }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; indexesRemovedItems = new LimitedSizeStack <int>(limit); stackValues = new LimitedSizeStack <TItem>(limit); stackKeys = new LimitedSizeStack <char>(limit); }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; ItemsStack = new LimitedSizeStack <TItem>(limit); ActionStack = new LimitedSizeStack <ActionMade>(limit); IndexStack = new LimitedSizeStack <int>(limit); }
public void WorkCorrectlyWhenLimitZero() { var stack = new LimitedSizeStack <int>(0); stack.Push(1); stack.Push(2); stack.Push(3); Assert.AreEqual(0, stack.Count); }
public void Count_StackSize() { var stack = new LimitedSizeStack <int>(20); stack.Push(0); stack.Push(10); stack.Push(20); Assert.AreEqual(3, stack.Count); }
public void ForgetFirstElement_AfterPushBeyondLimit() { var stack = new LimitedSizeStack <int>(2); stack.Push(0); stack.Push(10); stack.Push(20); Assert.AreEqual(2, stack.Count); Assert.AreEqual(20, stack.Pop()); }
public void PopAfterPush() { var stack = new LimitedSizeStack <int>(20); stack.Push(0); stack.Push(1); stack.Push(2); Assert.AreEqual(2, stack.Pop()); Assert.AreEqual(1, stack.Pop()); Assert.AreEqual(0, stack.Pop()); }
public void Push_ShouldTakeConstantTime() { int limit = 100000; var stack = new LimitedSizeStack <int>(limit); for (int i = 0; i < 5 * limit; ++i) { stack.Push(0); } Assert.AreEqual(limit, stack.Count); }
public void PushAfterEmptyStack() { var stack = new LimitedSizeStack <int>(20); stack.Push(0); stack.Push(1); stack.Pop(); stack.Pop(); stack.Push(2); Assert.AreEqual(2, stack.Pop()); }
public void PopPushAfterLimitReached() { var stack = new LimitedSizeStack <int>(2); stack.Push(0); stack.Push(1); stack.Push(2); stack.Pop(); stack.Push(3); Assert.AreEqual(3, stack.Pop()); Assert.AreEqual(1, stack.Pop()); }
public void StackDontKeepAllElements() { Counter counter = new Counter(); var stack = new LimitedSizeStack <FinalizableClass>(30); for (int i = 0; i < 100; ++i) { stack.Push(new FinalizableClass(counter)); } // Явный вызов сборщика мусора. В обычных программах так делать не нужно почти никогда. // Но в этом тесте нам нужно убедиться, что на вытесненные из стека элементы больше не осталось ссылок, // Для этого мы вызываем сборщик мусора и проверяем, у скольки объектов сборщик мусора вызвал деструктор GC.Collect(); GC.WaitForPendingFinalizers(); Assert.AreEqual(70, counter.Value); }
public UndoCommand(LimitedSizeStack <ICommand> historyStack) { this.HistoryStack = historyStack; }
public void BeEmpty_AfterCreation() { var stack = new LimitedSizeStack <int>(20); Assert.AreEqual(0, stack.Count); }
public ListModel(int limit) { Items = new List <TItem>(); Actions = new LimitedSizeStack <ListModelAction <TItem> >(limit); }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; executeList = new LimitedSizeStack <ExecuteList>(limit); }
public RemoveCommand(List <TItem> items, LimitedSizeStack <ICommand> backup, int index) { this.items = items; this.backup = backup; this.index = index; }
public AddCommand(List <TItem> items, TItem item, LimitedSizeStack <ICommand> backup) { this.items = items; this.item = item; this.backup = backup; }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; storyAction = new LimitedSizeStack <Tuple <TypeAction, TItem, int> >(limit); }
public ListModel(int limit) { Items = new List <TItem>(); this.limit = limit; actionStory = new LimitedSizeStack <Tuple <ActionType, TItem, int> >(limit); }
public History(int limit) { _commandHistory = new LimitedSizeStack <Command <T> >(limit); }
public NotesAndCommands(int limit) { Notes = new List <Tuple <int, TItem> >(); RecordedCommands = new LimitedSizeStack <Commands>(limit); }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; commandStack = new LimitedSizeStack <Command <TItem> >(limit); }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; stack = new LimitedSizeStack <StackNode <TItem> >(limit); }
public ListModel(int limit) { Limit = limit; Items = new List <TItem>(); Stack = new LimitedSizeStack <Tuple <TItem, int> >(Limit); }
public ListModel(int limit) { Items = new List <TItem>(); actionsList = new LimitedSizeStack <Tuple <Action, TItem, int> >(limit); Limit = limit; }
public ListModel(int limit) { Items = new List <TItem>(); Events = new LimitedSizeStack <Tuple <TItem, int, bool> >(limit); Limit = limit; }
public ListModel(int limit) { Items = new List <TItem>(); backup = new LimitedSizeStack <ICommand>(limit); }
public ListModel(int limit) { Items = new List <TItem>(); Limit = limit; Commands = new LimitedSizeStack <ICommand <TItem> >(Limit); }
public ListModel(int limit) { lastActions = new LimitedSizeStack <Tuple <bool, TItem> >(limit); Items = new List <TItem>(); Limit = limit; }