public void TestPushFront1To4() { var d = new Deq <int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.IsFalse(d.Empty); Assert.AreEqual(4, d.Count); }
public void TestPushFrontGetByPos() { var d = new Deq <int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.GetDeqElementByPosition(0)); Assert.AreEqual(3, d.GetDeqElementByPosition(1)); Assert.AreEqual(2, d.GetDeqElementByPosition(2)); Assert.AreEqual(1, d.GetDeqElementByPosition(3)); }
public void TestOrderPushFrontPopFront() { var d = new Deq <int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.PopFront()); Assert.AreEqual(3, d.PopFront()); Assert.AreEqual(2, d.PopFront()); Assert.AreEqual(1, d.PopFront()); }
public void TestPushFrontPopBackOne() { const int val = 100502; var d = new Deq <int>(); d.PushFront(val); Assert.AreEqual(val, d.PopBack()); Assert.IsTrue(d.Empty); Assert.AreEqual(0, d.Count); }
public void TestPushFront() { const int val = 100501; var d = new Deq <int>(); d.PushFront(val); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(val, d.Back); Assert.AreEqual(val, d.Front); }
public void TestSetDeqElementByPosition() { var d = new Deq <int>(); d.PushFront(1); d.SetDeqElementByPosition(0, 2); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(2, d.GetDeqElementByPosition(0)); Assert.AreEqual(2, d.PopFront()); }
private void button2_Click(object sender, EventArgs e) //вставить в начало { try { string con = textBox5.Text; int num = Convert.ToInt32(textBox7.Text); Deq.Train item = new Deq.Train(num, con); d.PushFront(item); } catch (Exception ex) { MessageBox.Show("Номер должен быть целым числом!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } d.Draw(this, pictureBox1, g, false); }
public void TestSetDeqElementByPosition() { var d = new Deq<int>(); d.PushFront(1); d.SetDeqElementByPosition(0, 2); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(2, d.GetDeqElementByPosition(0)); Assert.AreEqual(2, d.PopFront()); }
public void TestPushFrontPopBackOne() { const int val = 100502; var d = new Deq<int>(); d.PushFront(val); Assert.AreEqual(val, d.PopBack()); Assert.IsTrue(d.Empty); Assert.AreEqual(0, d.Count); }
public void TestPushFrontGetByPos() { var d = new Deq<int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.GetDeqElementByPosition(0)); Assert.AreEqual(3, d.GetDeqElementByPosition(1)); Assert.AreEqual(2, d.GetDeqElementByPosition(2)); Assert.AreEqual(1, d.GetDeqElementByPosition(3)); }
public void TestPushFront1To4() { var d = new Deq<int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.IsFalse(d.Empty); Assert.AreEqual(4, d.Count); }
public void TestPushFront() { const int val = 100501; var d = new Deq<int>(); d.PushFront(val); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(val, d.Back); Assert.AreEqual(val, d.Front); }
public void TestOrderPushFrontPopFront() { var d = new Deq<int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.PopFront()); Assert.AreEqual(3, d.PopFront()); Assert.AreEqual(2, d.PopFront()); Assert.AreEqual(1, d.PopFront()); }