public void testItemID()
 {
     IPreferenceArray prefs = new GenericUserPreferenceArray(3);
     Assert.AreEqual(3, prefs.Length());
     prefs.SetItemID(0, 1L);
     prefs.SetItemID(1, 2L);
     prefs.SetItemID(2, 3L);
     Assert.AreEqual(1L, prefs.GetItemID(0));
     Assert.AreEqual(2L, prefs.GetItemID(1));
     Assert.AreEqual(3L, prefs.GetItemID(2));
 }
예제 #2
0
        public void testSort()
        {
            IPreferenceArray prefs = new GenericUserPreferenceArray(3);

            prefs.Set(0, new GenericPreference(1L, 3L, 5.0f));
            prefs.Set(1, new GenericPreference(1L, 1L, 5.0f));
            prefs.Set(2, new GenericPreference(1L, 2L, 5.0f));
            prefs.SortByItem();
            Assert.AreEqual(1L, prefs.GetItemID(0));
            Assert.AreEqual(2L, prefs.GetItemID(1));
            Assert.AreEqual(3L, prefs.GetItemID(2));
        }
예제 #3
0
        public void testItemID()
        {
            IPreferenceArray prefs = new GenericUserPreferenceArray(3);

            Assert.AreEqual(3, prefs.Length());
            prefs.SetItemID(0, 1L);
            prefs.SetItemID(1, 2L);
            prefs.SetItemID(2, 3L);
            Assert.AreEqual(1L, prefs.GetItemID(0));
            Assert.AreEqual(2L, prefs.GetItemID(1));
            Assert.AreEqual(3L, prefs.GetItemID(2));
        }
 public void testClone()
 {
     GenericUserPreferenceArray prefs = new GenericUserPreferenceArray(3);
     prefs.Set(0, new GenericPreference(1L, 3L, 5.0f));
     prefs.Set(1, new GenericPreference(1L, 1L, 4.0f));
     prefs.Set(2, new GenericPreference(1L, 2L, 3.0f));
     prefs = (GenericUserPreferenceArray)prefs.Clone();
     Assert.AreEqual(3L, prefs.GetItemID(0));
     Assert.AreEqual(1L, prefs.GetUserID(1));
     Assert.AreEqual(3.0f, prefs.GetValue(2), EPSILON);
 }
예제 #5
0
        public void testClone()
        {
            GenericUserPreferenceArray prefs = new GenericUserPreferenceArray(3);

            prefs.Set(0, new GenericPreference(1L, 3L, 5.0f));
            prefs.Set(1, new GenericPreference(1L, 1L, 4.0f));
            prefs.Set(2, new GenericPreference(1L, 2L, 3.0f));
            prefs = (GenericUserPreferenceArray)prefs.Clone();
            Assert.AreEqual(3L, prefs.GetItemID(0));
            Assert.AreEqual(1L, prefs.GetUserID(1));
            Assert.AreEqual(3.0f, prefs.GetValue(2), EPSILON);
        }
 public void testSortValue()
 {
     IPreferenceArray prefs = new GenericUserPreferenceArray(3);
     prefs.Set(0, new GenericPreference(1L, 3L, 5.0f));
     prefs.Set(1, new GenericPreference(1L, 1L, 4.0f));
     prefs.Set(2, new GenericPreference(1L, 2L, 3.0f));
     prefs.SortByValue();
     Assert.AreEqual(2L, prefs.GetItemID(0));
     Assert.AreEqual(1L, prefs.GetItemID(1));
     Assert.AreEqual(3L, prefs.GetItemID(2));
     prefs.SortByValueReversed();
     Assert.AreEqual(3L, prefs.GetItemID(0));
     Assert.AreEqual(1L, prefs.GetItemID(1));
     Assert.AreEqual(2L, prefs.GetItemID(2));
 }
예제 #7
0
 public long GetItemID()
 {
     return(arr.GetItemID(i));
 }