public void testUserID()
        {
            IPreferenceArray prefs = new GenericItemPreferenceArray(3);

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

            prefs.Set(0, new GenericPreference(3L, 1L, 5.0f));
            prefs.Set(1, new GenericPreference(1L, 1L, 4.0f));
            prefs.Set(2, new GenericPreference(2L, 1L, 3.0f));
            prefs = (GenericItemPreferenceArray)prefs.Clone();
            Assert.AreEqual(3L, prefs.GetUserID(0));
            Assert.AreEqual(1L, prefs.GetItemID(1));
            Assert.AreEqual(3.0f, prefs.GetValue(2), EPSILON);
        }
Exemplo n.º 4
0
 public long GetItemID()
 {
     return(arr.GetItemID(i));
 }
 public void testUserID()
 {
     IPreferenceArray prefs = new GenericItemPreferenceArray(3);
     Assert.AreEqual(3, prefs.Length());
     prefs.SetItemID(0, 1L);
     Assert.AreEqual(1L, prefs.GetItemID(0));
     Assert.AreEqual(1L, prefs.GetItemID(1));
     Assert.AreEqual(1L, prefs.GetItemID(2));
 }