Exemple #1
0
        public void Add()
        {
            var td = new TypeDictionary <IServiceCollection, IServiceProvider>();

            Should.Throw <ArgumentException>(() => td.Add(typeof(ServiceDescriptor), typeof(ServiceProvider)));
            Should.Throw <ArgumentException>(() => td.Add(typeof(ServiceCollection), typeof(ServiceDescriptor)));
            Should.Throw <ArgumentException>(() => td.Add(new KeyValuePair <Type, Type>(typeof(ServiceCollection), typeof(ServiceDescriptor))));
            Should.NotThrow(() => td.Add(typeof(ServiceCollection), typeof(ServiceProvider)));
            Should.Throw <ArgumentException>(() => td.Add <ServiceCollection, ServiceProvider>());
            td.Clear();
            Should.NotThrow(() => td.Add <ServiceCollection, ServiceProvider>());
        }
Exemple #2
0
 /// <summary>
 /// Removes all target information from the factory.
 /// </summary>
 public static void Clear()
 {
     _targets.Clear();
 }
Exemple #3
0
 /// <summary>
 /// Removes all layout information from the factory.
 /// </summary>
 public static void Clear()
 {
     _name2type.Clear();
 }
Exemple #4
0
 /// <summary>
 /// Removes all filter information from the factory.
 /// </summary>
 public static void Clear()
 {
     _filters.Clear();
 }
Exemple #5
0
 private void ClearDictionary()
 {
     TypeDictionary.Clear();
 }