Exemplo n.º 1
0
        public T GetInstance <T>()
        {
            var typeOfT = typeof(T);

            if (!_registeredTypes.ContainsValue(typeOfT))
            {
                throw new KeyNotFoundException(
                          $"{typeOfT.Name} is not registered in this {nameof(MappedContainer)}.");
            }

            return(InitializerCache <T> .Value());
        }
 public void ValuesOperationTest()
 {
     foreach (var numberToString in SymbolTables)
     {
         foreach (var @string in numberToString.Values())
         {
             Assert.True(ExpectedNumberToString.ContainsValue(@string));
         }
     }
 }
Exemplo n.º 3
0
        private void SpinUpAccountActor(string accountNumber, ImmutableDictionary <string, string> obligations, IActorRef supervisor)
        {
            this.Monitor();
            var props        = Props.Create <AccountActor>();
            var accountActor = Context.ActorOf(props, name: accountNumber);

            accountActor.Tell(new CreateAccount(accountNumber));

            if (obligations.ContainsValue(accountNumber))
            {
                foreach (var obligation in obligations)
                {
                    if (obligation.Value == accountNumber)
                    {
                        var o = new Obligation(obligation.Key);
                        /* maybe messing with the  belongs in the reader? */
                        o = o.SetStatus(ObligationStatus.Active);
                        accountActor.Tell(new AddObligationToAccount(obligation.Value, o));
                    }
                }
            }
            accountActor.Tell(new AskToBeSupervised(supervisor));
        }
Exemplo n.º 4
0
 protected void ContainsValueTestHelper <TKey, TValue>(ImmutableDictionary <TKey, TValue> map, TKey key, TValue value)
 {
     Assert.False(map.ContainsValue(value));
     Assert.True(map.Add(key, value).ContainsValue(value));
 }
Exemplo n.º 5
0
 public override bool Contains(object?item) =>
 _dict.ContainsValue(item);
Exemplo n.º 6
0
 public bool HasValue(int value)
 => _cells.ContainsValue(value);
Exemplo n.º 7
0
 /// <summary>
 /// Tests if this dictionary contains a particular value.
 /// </summary>
 /// <param name="value">The value to look for.</param>
 /// <returns>
 /// <c>true</c> if this dictionary contains <paramref name="value"/>.
 /// </returns>
 public bool ContainsValue(TValue value)
 {
     return(innerDictionary.ContainsValue(value));
 }
Exemplo n.º 8
0
 public bool ContainsPrefix(string prefix)
 {
     return(_map.ContainsValue(prefix));
 }