Exemplo n.º 1
0
 private TestWorld(World world, string name)
 {
     World            = world;
     _mailboxProvider = new TestMailboxPlugin(World);
     _actorMessages   = new ConcurrentDictionary <long, IList <IMessage> >();
     Instance         = this;
 }
Exemplo n.º 2
0
        public void Keep(string name, bool isDefault, IMailboxProvider mailboxProvider)
        {
            var info = new MailboxProviderInfo(name, mailboxProvider);

            _mailboxProviderInfos[name] = info;

            if (_defaultProvider == null || isDefault)
            {
                _defaultProvider = info;
            }
        }
        internal void Keep(string name, bool isDefault, IMailboxProvider mailboxProvider)
        {
            if (mailboxProviderInfos.Count == 0)
            {
                isDefault = true;
            }
            else if (isDefault)
            {
                UndefaultCurrentDefault();
            }

            mailboxProviderInfos[name] = new MailboxProviderInfo(name, mailboxProvider, isDefault);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Registers the <c>IMailboxProvider</c> plugin by <paramref name="name"/>.
 /// </summary>
 /// <param name="name">The <c>string</c> name of the mailbox provider to register.</param>
 /// <param name="isDefault">The <c>bool</c> value indicating whether this is the default mailbox provider.</param>
 /// <param name="mailboxProvider">The <c>IMailboxProvider</c> to register.</param>
 public void Register(string name, bool isDefault, IMailboxProvider mailboxProvider)
 => mailboxProviderKeeper.Keep(name, isDefault, mailboxProvider);
 public DefaultMailboxProviderKeeperTest()
 {
     mailboxProvider = Substitute.For <IMailboxProvider>();
     keeper          = new DefaultMailboxProviderKeeper();
     keeper.Keep(MAILBOX_NAME, false, mailboxProvider);
 }
Exemplo n.º 6
0
 private TestWorld(World world, string name)
 {
     World           = world;
     MailboxProvider = new TestMailboxPlugin(World);
     Instance        = this;
 }
Exemplo n.º 7
0
 public void Register(string name, bool isDefault, IMailboxProvider mailboxProvider)
 {
 }
Exemplo n.º 8
0
 public MailboxProviderInfo(string name, IMailboxProvider mailboxProvider)
 {
     Name            = name;
     MailboxProvider = mailboxProvider;
 }
 internal MailboxProviderInfo(string name, IMailboxProvider mailboxProvider, bool isDefault)
 {
     Name            = name;
     MailboxProvider = mailboxProvider;
     IsDefault       = isDefault;
 }
 public MailboxProviderInfo(string name, IMailboxProvider mailboxProvider)
 {
     this.name            = name;
     this.mailboxProvider = mailboxProvider;
 }
 public DefaultMailboxProviderKeeperTest()
 {
     _mailboxProvider = Substitute.For <IMailboxProvider>();
     _keeper          = new DefaultMailboxProviderKeeper();
     _keeper.Keep(MailboxName, false, _mailboxProvider);
 }