コード例 #1
0
        public void FahClientSettingsModel_RefreshSlots_FromClientObjectModel()
        {
            // Arrange
            var model          = new FahClientSettingsModel();
            var slotCollection = new SlotCollection();
            var slotOptions    = new SlotOptions {
                { Options.ClientType, "foo" }, { Options.MaxPacketSize, "bar" }
            };

            slotCollection.Add(new Slot {
                ID = 0, Description = "cpu:15", SlotOptions = slotOptions
            });
            // Act
            model.RefreshSlots(slotCollection);
            // Assert
            Assert.AreEqual(1, model.Slots.Count);
            var slotModel = model.Slots.First();

            Assert.AreEqual("00", slotModel.ID);
            Assert.AreEqual("CPU", slotModel.SlotType);
            Assert.AreEqual("foo", slotModel.ClientType);
            Assert.AreEqual("bar", slotModel.MaxPacketSize);
        }
コード例 #2
0
 public void Add_Null_Exception()
 {
     Assert.Throws <ArgumentNullException>(() => _collection.Add(null));
 }