public void AddRange_NullObjectInValues_ThrowsArgumentException() { string[] objects = new string[] { "value1", null, "value2" }; var attribute = new DirectoryAttribute(); AssertExtensions.Throws <ArgumentException>("values", () => attribute.AddRange(objects)); Assert.Equal(0, attribute.Count); }
public void AddRange_Uris_Success() { Uri[] values = new Uri[] { new Uri("http://microsoft.com") }; var attribute = new DirectoryAttribute(); attribute.AddRange(values); Assert.Equal(1, attribute.Count); Assert.Equal(values, attribute.Cast <Uri>()); }
public void AddRange_ByteArrays_Success() { byte[][] values = new byte[][] { new byte[] { 1, 2, 3 }, new byte[0] }; var attribute = new DirectoryAttribute(); attribute.AddRange(values); Assert.Equal(2, attribute.Count); Assert.Equal(values, attribute.Cast <byte[]>()); }
public void AddRange_Strings_Success() { string[] values = new string[] { "value1", "value2" }; var attribute = new DirectoryAttribute(); attribute.AddRange(values); Assert.Equal(2, attribute.Count); Assert.Equal(values, attribute.Cast <string>()); }
public void AddRange_InvalidArray_ThrowsArgumentExceptionn() { var attribute = new DirectoryAttribute(); AssertExtensions.Throws <ArgumentException>("values", () => attribute.AddRange(new object[0])); }
public void AddRange_NullValues_ThrowsArgumentNullException() { var attribute = new DirectoryAttribute(); AssertExtensions.Throws <ArgumentNullException>("values", () => attribute.AddRange(null)); }