public void AddedItemsShouldBeContained(int value) { var list = new MemoryList <int>(); list.Add(value); Assert.True(list.Contains(value)); }
public void AddedItemsAreContained(int val) { var list = new MemoryList <int>(); list.Add(val); Assert.True(list.Contains(val)); }
public void ContainIsFalse() { var list = new MemoryList <int>(); list.Add(7); Assert.False(list.Contains(9)); }
public void ContainsShouldBeFalse() { var Memory = new MemoryList(); var result = Memory.Contains("asdf"); Assert.False(result); }
public void ContainIsTrue() { var list = new MemoryList <int>(); list.Add(7); Assert.True(list.Contains(7)); }
public void RemovedItemsShouldNotBeContained() { var list = new MemoryList <int>(); list.Add(5); list.Remove(5); Assert.True(list.Contains(5)); }
public void ContainsShouldBeTrueForContained() { var list = new MemoryList <int>(); list.Add(6); var result = list.Contains(6); Assert.True(result); }
public void ListCanRemove() { var list = new MemoryList <int>(); list.Add(7); list.Remove(7); Assert.False(list.Contains(7)); }
public void ContainsShouldBeTrueIfValueEverContained(int value) { // arrange var memoryList = new MemoryList <int>(); //act memoryList.Add(-5); memoryList.Add(10); memoryList.Remove(10); // assert Assert.True(memoryList.HasEverContained(value)); // act var result = memoryList.Contains(value); // assert Assert.False(memoryList.Contains(value)); }
public void RemoveShouldRemoveSingleItem(int value) { //arrange, act, assert var list = new MemoryList <int>(); list.Add(value); list.Remove(value); Assert.False(list.Contains(value)); }
public void ContainsShouldBeFalseForNotContained() { var list = new MemoryList <int>(); list.Add(7); list.Remove(7); var result = list.Contains(7); Assert.False(result); }
public void RemoveShouldNotThrowException() { var Memory = new MemoryList(); Memory.Add("blah"); Memory.Remove(); var result = Memory.Contains("blah"); Assert.False(result); }
public void RemoveShouldRemoveVariable(int value) { // arrange var memoryList = new MemoryList <int>(); //act memoryList.Add(-5); memoryList.Add(10); memoryList.Add(10000); memoryList.Remove(value); // assert Assert.False(memoryList.Contains(value)); }
public void ContainsShouldBeTrueForContained(int value) { // arrange var memoryList = new MemoryList <int>(); if (value > 0) { memoryList.Add(value); } // act var result = memoryList.Contains(value); // assert Assert.True(result); }
public IEnumerator Talk(MemoryList memoryList, DialogDisplay dialogBox, OnDialogFinish onDialogFinish) { bool keepTalking = true; while (keepTalking) { if (node == null) { keepTalking = false; } else if (node is DialogTextNode) { DialogTextNode textNode = (DialogTextNode)node; if (textNode.requireItems == null || memoryList.Contains(textNode.requireItems)) { yield return(dialogBox.DisplayText(textNode.dialogs)); if (textNode.addItems != null) { foreach (string item in textNode.addItems) { memoryList.AddItem(item); } } if (node.children != null) { node = node.children[0]; if (node.id == 999) { GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>().GameEnd(); onDialogFinish(); yield break; } } else { node = null; } } else { yield return(dialogBox.DisplayText(new string[] { "Hi Ben!" })); } keepTalking = false; } else if (node is DialogOptionNode) { DialogOptionNode optionNode = (DialogOptionNode)node; string[] availableOptions = optionNode.options .Where((option) => !option.selected && (option.requireItems == null || memoryList.Contains(option.requireItems))) .Select((option) => option.text).ToArray(); if (availableOptions.Length > 0) { yield return(dialogBox.DisplayOptionList(availableOptions, (selection) => { node = optionNode.Select(selection); })); if (optionNode == node) { keepTalking = false; } } else { yield return(dialogBox.DisplayText(new string[] { "Hi Ben!" })); keepTalking = false; } } yield return(null); } onDialogFinish(); }