public void Indekser_Stos() { stos = new StosWTablicy <char>(); stos.Push('a'); stos.Push('b'); stos.Push('c'); Assert.AreEqual('b', stos[1]); }
public void Indexer() { stos = new StosWLiscie <char>(); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); for (int i = 0; i < stos.Count; i++) { Console.WriteLine(stos[i]); } }
public void TrimExcess() { stos = new StosWTablicy <char>(); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); stos.Clear(); stos.TrimExcess(); Assert.AreEqual(0, stos.Count); }
public void IndexerCzyZwracaOdpowiednielement() { stos = new StosWTablicy <char>(); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); char[] tab = stos.ToArray(); for (int i = 0; i < 4; i++) { Assert.AreEqual(stos[i], tab[i]); } }
public void StackUpdatingToTheSameState() { stack = new StosWTablicy <char>(); stack.Push(RandomChar); stack.Push(RandomChar); char[] tab1 = stack.ToArray(); char e = RandomChar; stack.Push(e); stack.Pop(); char[] tab2 = stack.ToArray(); CollectionAssert.AreEqual(tab1, tab2); }
public void PushPop_StosSieNieZmienia() { stos = new StosWTablicy <char>(); stos.Push(RandomElement); stos.Push(RandomElement); char[] tabPrzed = stos.ToArray(); char e = RandomElement; stos.Push(e); stos.Pop(); char[] tabPo = stos.ToArray(); CollectionAssert.AreEqual(tabPrzed, tabPo); }
public void TrimExceptionCzyZmieniarozmiarTablicy() { stos = new StosWTablicy <char>(2); char e = RandomElement; stos.Push(e); stos.Push(e); ((StosWTablicy <char>)stos).TrimExcess(); stos.Push(e); ((StosWTablicy <char>)stos).TrimExcess(); int temp = ((StosWTablicy <char>)stos).Capacity; Assert.IsTrue(temp == 4); }
public void Indexer_Test_Tablica() { stos = new StosWTablicy <char>(); var element = RandomElement; stos.Push(element); Assert.AreEqual(stos[0], element); }
public void Indekser_Test_Lista() { stos = new StosWLiscie <char>(); var element = RandomElement; stos.Push(element); Assert.AreEqual(stos[0], element); }
public void Peek_ZwracaOstatnioWstawionyElement() { stos = new StosWTablicy <char>(); char e = RandomElement; stos.Push(e); Assert.AreEqual(stos.Peek, e); }
public void IndexerWTablicy() { stos = new StosWTablicy <char>(); var el = RandomElement; stos.Push(el); Assert.AreEqual(stos[0], el); }
public void StackPeek() { stack = new StosWTablicy <char>(); char e = RandomChar; stack.Push(e); Assert.AreEqual(stack.Peek, e); }
public void StosIEnumeratorCzyEnumeruje() { stos = new StosWTablicy <char>(); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); stos.Push(RandomElement); char[] tab = stos.ToArray(); int i = 0; var enumerator = stos.ToArray().GetEnumerator(); while (enumerator.MoveNext()) { char s = (char)enumerator.Current; Assert.AreEqual(s, tab[i]); i++; } }
public void TrimExcess(int d) { stos = new StosWTablicy <char>(); for (int i = 0; i < d; i++) { stos.Push(RandomElement); } stos.TrimExcess(); int l = stos.Count + (int)Math.Floor(stos.Count * 0.1); Assert.AreEqual(stos.Lenght, l); }
public void TrimExcess_Usunięcie10p_Komórek() { stos = new StosWTablicy <char>(); for (int i = 0; i < 100; i++) { stos.Push(RandomElement); } stos.TrimExcess(); int ss = stos.Count; Assert.AreEqual(90, ss); }
public void TrimExcessWTablicy() { stos = new StosWTablicy <char>(); for (int i = 0; i < 142; i++) { stos.Push(RandomElement); } stos.TrimExcess(); Assert.AreEqual(127, stos.Count); }
public void IsEmpty_PoUtworzeniuIDodaniuElementuStosNieJestPusty() { stos = new StosWTablicy <char>(); stos.Push(RandomElement); Assert.IsFalse(stos.IsEmpty); }
public void StackNotEmpty() { stack = new StosWTablicy <char>(); stack.Push(RandomChar); Assert.IsTrue(!stack.IsEmpty); }