public void SsdpDevicePropertiesCollection_Contains_PropertyWithNullNameThrows() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty(); properties.Contains(p); }
public void SsdpDevicePropertiesCollection_Add_NullFullNameThrows() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty(); properties.Add(p); }
public void SsdpDevicePropertiesCollection_Add_EmptyFullNameThrows() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = String.Empty, Namespace = String.Empty }; properties.Add(p); }
public void SsdpDevicePropertiesCollection_Contains_PropertyWithEmptyNameThrows() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = String.Empty, Namespace = String.Empty }; properties.Contains(p); }
/// <summary> /// Derived type constructor, allows constructing a device with no parent. Should only be used from derived types that are or inherit from <see cref="SsdpRootDevice"/>. /// </summary> protected SsdpDevice() { _DeviceTypeNamespace = SsdpConstants.UpnpDeviceTypeNamespace; _DeviceType = SsdpConstants.UpnpDeviceTypeBasicDevice; _DeviceVersion = 1; this.Icons = new List<SsdpDeviceIcon>(); _Devices = new List<SsdpDevice>(); this.Devices = new ReadOnlyEnumerable<SsdpDevice>(_Devices); _CustomProperties = new SsdpDevicePropertiesCollection(); }
public void SsdpDevicePropertiesCollection_Count_ReturnsZeroAfterLastItemRemoved() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; properties.Remove(prop); Assert.AreEqual(0, properties.Count); }
public void SsdpDevicePropertiesCollection_Contains_ReturnsFalseForNonExistentKey() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; properties.Add(prop); Assert.AreEqual(false, properties.Contains("NotAValidKey")); }
public void SsdpDevicePropertiesCollection_Contains_ReturnsTrueForExistingItem() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; properties.Add(prop); Assert.AreEqual(true, properties.Contains(prop)); }
public void SsdpDevicePropertiesCollection_Indexer_Succeeds() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = "Test", Namespace = "TestNamespace", Value = "some value" }; properties.Add(p); Assert.AreEqual(p, properties[p.FullName]); }
public void SsdpDevicePropertiesCollection_Indexer_ThrowsOnUnknownKey() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = "Test", Namespace = "TestNamespace", Value = "some value" }; properties.Add(p); Assert.AreEqual(p, properties["NotAValidKey"]); }
public void SsdpDevicePropertiesCollection_Count_ReturnsOneAfterItemAdded() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; properties.Add(prop); Assert.AreEqual(1, properties.Count); }
public void SsdpDevicePropertiesCollection_Remove_RemoveByKeySucceeds() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = "TestProp1", Namespace = "TestNamespace" }; properties.Add(p); Assert.AreEqual(true, properties.Remove(p.FullName)); Assert.AreEqual(0, properties.Count); }
public void SsdpDevicePropertiesCollection_GetEnumerator_Success() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; properties.Add(prop); var enumerator = ((IEnumerable)properties).GetEnumerator(); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(prop, enumerator.Current); Assert.AreEqual(false, enumerator.MoveNext()); }
public void SsdpDevicePropertiesCollection_Remove_RemoveInstanceForDifferentInstanceWithSameKeyReturnsFalse() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = "TestProp1", Namespace = "TestNamespace" }; var p2 = new SsdpDeviceProperty() { Name = "TestProp1", Namespace = "TestNamespace" }; properties.Add(p); Assert.AreEqual(false, properties.Remove(p2)); Assert.AreEqual(1, properties.Count); }
public void SsdpDevicePropertiesCollection_Contains_ReturnsFalseForExistingKeyDifferentItem() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; var prop2 = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; properties.Add(prop); Assert.AreEqual(false, properties.Contains(prop2)); }
public void SsdpDevicePropertiesCollection_Contains_ReturnsFalseForNonExistentProperty() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; var prop2 = new SsdpDeviceProperty() { Name = "TestProperty1", Namespace = "MyNamespace", Value = "1.0" }; properties.Add(prop); Assert.AreEqual(false, properties.Contains(prop2)); }
public void SsdpDevicePropertiesCollection_Count_ReturnsZeroForNewCollection() { var properties = new SsdpDevicePropertiesCollection(); Assert.AreEqual(0, properties.Count); }
public void SsdpDevicePropertiesCollection_Remove_EmptyKeyThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Remove(String.Empty); }
public void SsdpDevicePropertiesCollection_Contains_NullPropertyThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Contains((SsdpDeviceProperty)null); }
public void SsdpDevicePropertiesCollection_Contains_PropertyWithEmptyNameThrows() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = String.Empty, Namespace= String.Empty }; properties.Contains(p); }
public void SsdpDevicePropertiesCollection_Contains_EmptyNameThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Contains(String.Empty); }
public void SsdpDevicePropertiesCollection_Contains_NullNameThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Contains((string)null); }
public void SsdpDevicePropertiesCollection_CapacityConstructor_SucceedsWithZeroValue() { var properties = new SsdpDevicePropertiesCollection(0); }
public void SsdpDevicePropertiesCollection_CapacityConstructor_Succeeds() { var properties = new SsdpDevicePropertiesCollection(10); }
public void SsdpDevicePropertiesCollection_CapacityConstructor_FailsWithNegativeValue() { var properties = new SsdpDevicePropertiesCollection(-1); }
public void SsdpDevicePropertiesCollection_Remove_NullKeyThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Remove((string)null); }
public void SsdpDevicePropertiesCollection_Add_NullThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Add(null); }
public void SsdpDevicePropertiesCollection_Add_NullDeviceThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Add(null); }
public void SsdpDevicePropertiesCollection_Remove_NullThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Remove((SsdpDeviceProperty)null); }
public void SsdpDevicePropertiesCollection_Contains_ReturnsTrueForExistingKey() { var properties = new SsdpDevicePropertiesCollection(); var prop = new SsdpDeviceProperty() { Name = "TestProperty", Namespace = "MyNamespace", Value = "1.0" }; properties.Add(prop); Assert.AreEqual(true, properties.Contains(prop.FullName)); }
public void SsdpDevicePropertiesCollection_Remove_NullFullNameThrows() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty(); properties.Remove(p); }
public void SsdpDevicePropertiesCollection_Remove_NullDeviceThrows() { var properties = new SsdpDevicePropertiesCollection(); properties.Remove((SsdpDeviceProperty)null); }
public void SsdpDevicePropertiesCollection_Remove_RemoveInstanceSucceeds() { var properties = new SsdpDevicePropertiesCollection(); var p = new SsdpDeviceProperty() { Name = "TestProp1", Namespace = "TestNamespace" }; properties.Add(p); Assert.AreEqual(true, properties.Remove(p)); Assert.AreEqual(0, properties.Count); }