public void ZeroElements() { DoubleColumn d = new DoubleColumn(); Assert.AreEqual(0, d.Count); Assert.AreEqual(false, d.IsDirty); Assert.AreEqual(true, d.IsElementEmpty(0)); Assert.AreEqual(true, d.IsElementEmpty(1)); }
public void TenEmptyElements() { DoubleColumn d = new DoubleColumn(10); Assert.AreEqual(0, d.Count); Assert.AreEqual(false, d.IsDirty); for (int i = 0; i < 11; i++) Assert.AreEqual(true, d.IsElementEmpty(i)); }
public void TenElementsFirstFilled() { DoubleColumn d = new DoubleColumn(10); Assert.AreEqual(0, d.Count); d[0] = 77.0; Assert.AreEqual(1, d.Count); Assert.AreEqual(false, d.IsDirty); Assert.AreEqual(false, d.IsElementEmpty(0)); Assert.AreEqual(true, d.IsElementEmpty(1)); // now delete again element 0 d[0] = double.NaN; Assert.AreEqual(0, d.Count); Assert.AreEqual(false, d.IsDirty); for (int i = 0; i < 11; i++) Assert.AreEqual(true, d.IsElementEmpty(i)); Assert.AreEqual(false, d.IsDirty); }
public void FiveElements89Filled() { DoubleColumn d = new DoubleColumn(5); Assert.AreEqual(0, d.Count); d[8] = 77.0; d[9] = 88; Assert.AreEqual(10, d.Count); Assert.AreEqual(false, d.IsDirty); Assert.AreEqual(true, d.IsElementEmpty(7)); Assert.AreEqual(false, d.IsElementEmpty(8)); Assert.AreEqual(false, d.IsElementEmpty(9)); Assert.AreEqual(true, d.IsElementEmpty(10)); d[9] = double.NaN; Assert.AreEqual(9, d.Count, 9); Assert.AreEqual(true, d.IsElementEmpty(7)); Assert.AreEqual(false, d.IsElementEmpty(8)); Assert.AreEqual(true, d.IsElementEmpty(9)); Assert.AreEqual(true, d.IsElementEmpty(10)); d[8] = double.NaN; Assert.AreEqual(0, d.Count, 0); Assert.AreEqual(true, d.IsElementEmpty(7)); Assert.AreEqual(true, d.IsElementEmpty(8)); Assert.AreEqual(true, d.IsElementEmpty(9)); Assert.AreEqual(true, d.IsElementEmpty(10)); Assert.AreEqual(false, d.IsDirty); for (int i = 0; i < 11; i++) Assert.AreEqual(true, d.IsElementEmpty(i)); }