本文整理汇总了C#中AccessRights.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# AccessRights.AddRange方法的具体用法?C# AccessRights.AddRange怎么用?C# AccessRights.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccessRights
的用法示例。
在下文中一共展示了AccessRights.AddRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestArgumentExceptions
public void TestArgumentExceptions ()
{
var enumeratedRights = new [] { AccessRight.OpenFolder, AccessRight.CreateFolder };
Assert.Throws<ArgumentNullException> (() => new AccessControl (null));
Assert.Throws<ArgumentNullException> (() => new AccessControl (null, "rk"));
Assert.Throws<ArgumentNullException> (() => new AccessControl (null, enumeratedRights));
Assert.Throws<ArgumentNullException> (() => new AccessControl ("name", (string) null));
Assert.Throws<ArgumentNullException> (() => new AccessControl ("name", (IEnumerable<AccessRight>) null));
Assert.Throws<ArgumentNullException> (() => new AccessControlList (null));
Assert.Throws<ArgumentNullException> (() => new AccessRights ((IEnumerable<AccessRight>) null));
Assert.Throws<ArgumentNullException> (() => new AccessRights ((string) null));
var rights = new AccessRights ();
Assert.Throws<ArgumentNullException> (() => rights.AddRange ((string) null));
Assert.Throws<ArgumentNullException> (() => rights.AddRange ((IEnumerable<AccessRight>) null));
Assert.Throws<ArgumentNullException> (() => new AlertEventArgs (null));
Assert.Throws<ArgumentNullException> (() => new FolderNamespace ('.', null));
var namespaces = new FolderNamespaceCollection ();
FolderNamespace ns;
Assert.Throws<ArgumentNullException> (() => namespaces.Add (null));
Assert.Throws<ArgumentNullException> (() => namespaces.Contains (null));
Assert.Throws<ArgumentNullException> (() => namespaces.Remove (null));
Assert.Throws<ArgumentOutOfRangeException> (() => ns = namespaces[-1]);
Assert.Throws<ArgumentOutOfRangeException> (() => namespaces[-1] = new FolderNamespace ('.', ""));
namespaces.Add (new FolderNamespace ('.', ""));
Assert.Throws<ArgumentNullException> (() => namespaces[0] = null);
Assert.Throws<ArgumentNullException> (() => new FolderNotFoundException (null));
Assert.Throws<ArgumentNullException> (() => new FolderNotFoundException ("message", null));
Assert.Throws<ArgumentNullException> (() => new FolderNotFoundException ("message", null, new Exception ("message")));
Assert.Throws<ArgumentNullException> (() => new FolderNotOpenException (null, FolderAccess.ReadOnly));
Assert.Throws<ArgumentNullException> (() => new FolderNotOpenException (null, FolderAccess.ReadOnly, "message"));
Assert.Throws<ArgumentNullException> (() => new FolderNotOpenException (null, FolderAccess.ReadOnly, "message", new Exception ("message")));
Assert.Throws<ArgumentNullException> (() => new FolderRenamedEventArgs (null, "name"));
Assert.Throws<ArgumentNullException> (() => new FolderRenamedEventArgs ("name", null));
Assert.Throws<ArgumentOutOfRangeException> (() => new MessageEventArgs (-1));
Assert.Throws<ArgumentNullException> (() => new MessageFlagsChangedEventArgs (0, MessageFlags.Answered, null));
Assert.Throws<ArgumentNullException> (() => new MessageFlagsChangedEventArgs (0, MessageFlags.Answered, null, 1));
Assert.Throws<ArgumentNullException> (() => new MessageFlagsChangedEventArgs (0, UniqueId.MinValue, MessageFlags.Answered, null));
Assert.Throws<ArgumentNullException> (() => new MessageFlagsChangedEventArgs (0, UniqueId.MinValue, MessageFlags.Answered, null, 1));
Assert.Throws<ArgumentNullException> (() => new MessageLabelsChangedEventArgs (0, null));
Assert.Throws<ArgumentNullException> (() => new MessageLabelsChangedEventArgs (0, null, 1));
Assert.Throws<ArgumentNullException> (() => new MessageLabelsChangedEventArgs (0, UniqueId.MinValue, null));
Assert.Throws<ArgumentNullException> (() => new MessageLabelsChangedEventArgs (0, UniqueId.MinValue, null, 1));
Assert.Throws<ArgumentNullException> (() => new MessageSentEventArgs (null, "response"));
Assert.Throws<ArgumentNullException> (() => new MessageSentEventArgs (new MimeMessage (), null));
Assert.Throws<ArgumentNullException> (() => new MessageSummaryFetchedEventArgs (null));
Assert.Throws<ArgumentNullException> (() => new MessagesVanishedEventArgs (null, false));
Assert.Throws<ArgumentNullException> (() => new MetadataCollection (null));
var metadataOptions = new MetadataOptions ();
Assert.Throws<ArgumentOutOfRangeException> (() => metadataOptions.Depth = 500);
Assert.Throws<ArgumentOutOfRangeException> (() => new ModSeqChangedEventArgs (-1));
Assert.Throws<ArgumentOutOfRangeException> (() => new ModSeqChangedEventArgs (-1, 1));
Assert.Throws<ArgumentOutOfRangeException> (() => new ModSeqChangedEventArgs (-1, UniqueId.MinValue, 1));
Assert.Throws<ArgumentOutOfRangeException> (() => new OrderBy (OrderByType.To, SortOrder.None));
Assert.Throws<ArgumentNullException> (() => new ProtocolLogger ((string) null));
Assert.Throws<ArgumentNullException> (() => new ProtocolLogger ((Stream) null));
using (var logger = new ProtocolLogger (new MemoryStream ())) {
var buffer = new byte[1024];
Assert.Throws<ArgumentNullException> (() => logger.LogConnect (null));
Assert.Throws<ArgumentNullException> (() => logger.LogClient (null, 0, 0));
Assert.Throws<ArgumentNullException> (() => logger.LogServer (null, 0, 0));
Assert.Throws<ArgumentOutOfRangeException> (() => logger.LogClient (buffer, -1, 0));
Assert.Throws<ArgumentOutOfRangeException> (() => logger.LogServer (buffer, -1, 0));
Assert.Throws<ArgumentOutOfRangeException> (() => logger.LogClient (buffer, 0, -1));
Assert.Throws<ArgumentOutOfRangeException> (() => logger.LogServer (buffer, 0, -1));
}
Assert.Throws<ArgumentNullException> (() => new UniqueIdMap (null, new [] { UniqueId.MinValue }));
Assert.Throws<ArgumentNullException> (() => new UniqueIdMap (new [] { UniqueId.MinValue }, null));
}