コード例 #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>());
        }
コード例 #2
0
 /// <summary>
 /// Removes all target information from the factory.
 /// </summary>
 public static void Clear()
 {
     _targets.Clear();
 }
コード例 #3
0
ファイル: LayoutFactory.cs プロジェクト: tmpkus/openvss
 /// <summary>
 /// Removes all layout information from the factory.
 /// </summary>
 public static void Clear()
 {
     _name2type.Clear();
 }
コード例 #4
0
 /// <summary>
 /// Removes all filter information from the factory.
 /// </summary>
 public static void Clear()
 {
     _filters.Clear();
 }
コード例 #5
0
 private void ClearDictionary()
 {
     TypeDictionary.Clear();
 }