public void CurrentException2() 
 {
   FloatVector test = new FloatVector(new float[2]{1f,2f});
   IEnumerator enumerator = test.GetEnumerator();
   enumerator.MoveNext();
   enumerator.MoveNext();
   enumerator.MoveNext();
   object value=enumerator.Current;
 }
 public void Current()
 {
   FloatVector test = new FloatVector(new float[2]{1f,2f});
   IEnumerator enumerator = test.GetEnumerator();
   bool movenextresult;
   
   movenextresult=enumerator.MoveNext();
   Assert.IsTrue(movenextresult);
   Assert.AreEqual(enumerator.Current,test[0]);
   
   movenextresult=enumerator.MoveNext();
   Assert.IsTrue(movenextresult);
   Assert.AreEqual(enumerator.Current,test[1]);
   
   movenextresult=enumerator.MoveNext();
   Assert.IsFalse(movenextresult);
 }
Пример #3
0
 public void GetEnumerator()
 {
   FloatVector a = new FloatVector(new float[4]{0,1,2,3});
   IEnumerator dve = a.GetEnumerator();
   float b;
   bool c;
   
   c = dve.MoveNext();
   b = (float)dve.Current;
   Assert.AreEqual(c,true);
   Assert.AreEqual(b,0);
   
   c = dve.MoveNext();
   b = (float)dve.Current;
   Assert.AreEqual(c,true);
   Assert.AreEqual(b,1);
   
   c = dve.MoveNext();
   b = (float)dve.Current;
   Assert.AreEqual(c,true);
   Assert.AreEqual(b,2);
   
   c = dve.MoveNext();
   b = (float)dve.Current;
   Assert.AreEqual(c,true);
   Assert.AreEqual(b,3);
   
   c = dve.MoveNext();
   Assert.AreEqual(c,false);
 }
Пример #4
0
 public void GetEnumeratorException()
 {
   FloatVector a = new FloatVector(new float[4]{0,1,2,3});
   IEnumerator dve = a.GetEnumerator();
   
   double b = (double)dve.Current;
 }