24 Assert.AreEqual(100, ciq.
Capacity,
"Capacity is the same as initialized value");
25 Assert.AreEqual(0, ciq.
Count,
"Buffer starts with no items");
26 Assert.IsTrue(ciq.
IsEmpty,
"Buffer starts out empty");
34 Assert.IsFalse(ciq.
IsEmpty,
"Not empty.");
36 for (
int t = 0; t <= 12345; ++t) {
41 Assert.AreEqual(t, mu.
id,
"Got the same value that we put.");
44 int currentId = bar.
id;
45 for (
int t = 0; t < ciq.
Capacity; t++) {
49 Assert.AreEqual(chew.
id, currentId,
"Older objects are in order: " + chew.
id +
", " + currentId);
58 for (
int t = 0; t <= 12345; ++t) {
60 Assert.AreEqual(-1, foo.id,
"Get default object from empty buffer");
64 for (
int t = 1; t <= 12345; ++t) {
66 Assert.AreEqual(-1, foo.id,
"Get default object past last item in mostly empty buffer");
68 for (
int t = 0; t <= 122; ++t) {
72 for (
int t = ciq.
Capacity; t <= 12345; ++t) {
74 Assert.AreEqual(-1, foo.id,
"Get default object past last item in full buffer");
80 Assert.AreEqual(10, ciq.
Capacity,
"Capacity is the same as initialized value");
81 Assert.AreEqual(0, ciq.
Count,
"Buffer starts with no items");
82 for (
int t = 0; t < 5; ++t) {
88 Assert.AreEqual(5, ciq.
Count,
"Buffer has 5 items");
90 Assert.AreEqual(bar.
id, 4,
"Objects are still in order: " + bar.
id +
", " + 4);
92 Assert.AreEqual(bar.
id, 3,
"Objects are still in order: " + bar.
id +
", " + 3);
94 Assert.AreEqual(bar.
id, 2,
"Objects are still in order: " + bar.
id +
", " + 2);
96 Assert.AreEqual(bar.
id, 1,
"Objects are still in order: " + bar.
id +
", " + 1);
98 Assert.AreEqual(bar.
id, 0,
"Objects are still in order: " + bar.
id +
", " + 0);
104 Assert.AreEqual(10, ciq.
Capacity,
"Capacity is the same as initialized value");
105 Assert.AreEqual(0, ciq.
Count,
"Buffer starts with no items");
106 for (
int t = 0; t < 5; ++t) {
110 Assert.AreEqual(5, ciq.
Count,
"Buffer has 5 items");
112 Assert.AreEqual(15, ciq.
Capacity,
"Capacity now is 15");
113 Assert.AreEqual(5, ciq.
Count,
"Buffer still has 5 items");
116 Assert.AreEqual(4, bar.
id,
"Objects are still in order: " + bar.
id +
", " + 4);
118 Assert.AreEqual(3, bar.
id,
"Objects are still in order: " + bar.
id +
", " + 3);
120 Assert.AreEqual(2, bar.
id,
"Objects are still in order: " + bar.
id +
", " + 2);
122 Assert.AreEqual(1, bar.
id,
"Objects are still in order: " + bar.
id +
", " + 1);
124 Assert.AreEqual(0, bar.
id,
"Objects are still in order: " + bar.
id +
", " + 0);
126 for (
int t = 0; t <= 12345; ++t) {
130 Assert.AreEqual(t, foo.
id,
"Got the same value that we put.");
134 int currentId = mu.
id;
135 for (
int t = 0; t < ciq.
Capacity; t++) {
138 Assert.AreEqual(mu.id, currentId,
"Older objects are in order: " + mu.id +
", " + currentId);
virtual void Put(ref T item)
void Resize(int newCapacity)
void Get(out T t, int index=0)