public void EmptyTest() { DataBlockInfo dataBlockInfo = new DataBlockInfo(0, null); for (int i = 0; i < 10; i++) { Console.WriteLine(dataBlockInfo.AddData()); } dataBlockInfo.RemoveData(9); dataBlockInfo.RemoveData(7); dataBlockInfo.RemoveData(8); dataBlockInfo.RemoveData(0); dataBlockInfo.RemoveData(5); dataBlockInfo.RemoveData(6); dataBlockInfo.RemoveData(4); dataBlockInfo.RemoveData(1); dataBlockInfo.RemoveData(2); dataBlockInfo.RemoveData(3); //Console.WriteLine(dataBlockInfo.IsEmpty); Assert.AreEqual(dataBlockInfo.IsEmpty, true); for (int i = 0; i < 15; i++) { Console.WriteLine(dataBlockInfo.AddData()); } }
public void BlockTest() { DataBlockInfo dataBlockInfo = new DataBlockInfo(0, null); for (int i = 0; i < 70; i++) { Console.WriteLine(dataBlockInfo.AddData()); } dataBlockInfo.RemoveData(10); dataBlockInfo.RemoveData(7); dataBlockInfo.RemoveData(20); dataBlockInfo.RemoveData(50); dataBlockInfo.RemoveData(50); dataBlockInfo.RemoveData(-1); dataBlockInfo.RemoveData(70); dataBlockInfo.RemoveData(6); dataBlockInfo.RemoveData(6); dataBlockInfo.RemoveData(-1); dataBlockInfo.RemoveData(70); Assert.AreEqual(false, dataBlockInfo[10]); Assert.AreEqual(false, dataBlockInfo[7]); Assert.AreEqual(false, dataBlockInfo[20]); Assert.AreEqual(false, dataBlockInfo[50]); Assert.AreEqual(false, dataBlockInfo[6]); Assert.AreEqual(false, dataBlockInfo[-1]); Assert.AreEqual(false, dataBlockInfo[70]); Assert.AreEqual(true, dataBlockInfo[8]); Assert.AreEqual(true, dataBlockInfo[14]); Assert.AreEqual(true, dataBlockInfo[35]); Assert.AreEqual(true, dataBlockInfo[49]); Assert.AreEqual(10, dataBlockInfo.AddData()); Assert.AreEqual(7, dataBlockInfo.AddData()); Assert.AreEqual(20, dataBlockInfo.AddData()); Assert.AreEqual(50, dataBlockInfo.AddData()); Assert.AreEqual(6, dataBlockInfo.AddData()); Assert.AreEqual(-1, dataBlockInfo.AddData()); Assert.AreEqual(-1, dataBlockInfo.AddData()); }
public void RemoveEntity(int id) { dataBlockInfo.RemoveData(id); }