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));
         }
     }
 }
Example #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));
        }
Example #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));
 }
Example #5
0
 public override bool Contains(object?item) =>
 _dict.ContainsValue(item);
Example #6
0
 public bool HasValue(int value)
 => _cells.ContainsValue(value);
Example #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));
 }
Example #8
0
 public bool ContainsPrefix(string prefix)
 {
     return(_map.ContainsValue(prefix));
 }