Beispiel #1
0
 // Sets the factor with the given index to the given value.
 // Adjusts the product accordingly.
 public void Set(int index, float factor)
 {
     factors.Set(index, factor);
     UpdateProduct();
 }
Beispiel #2
0
 // Sets the factor with the given index to the given value.
 // Adjusts the time rate accordingly.
 public void Set(int index, float factor)
 {
     factors.Set(index, factor);
     UpdateTimeRate();
 }
        public void TestSetNullKey()
        {
            IndexedList<string, SiteLink> list = new IndexedList<string, SiteLink>(siteLink => siteLink.SiteId) {
                new SiteLink("enwiki", "Foo")
            };

            Assert.Throws<ArgumentNullException>(() => list.Set(new SiteLink()));
        }
        public void TestSet()
        {
            IndexedList<string, SiteLink> list = new IndexedList<string, SiteLink> (siteLink => siteLink.SiteId) {
                new SiteLink("enwiki", "Foo")
            };
            list.Set(new SiteLink("enwiki", "Bar"));

            Assert.Equal("Bar", list["enwiki"].PageName);
        }
 public void Set(int index, TValue value)
 {
     list.Set(index, value);
 }