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>()); }
/// <summary> /// Removes all target information from the factory. /// </summary> public static void Clear() { _targets.Clear(); }
/// <summary> /// Removes all layout information from the factory. /// </summary> public static void Clear() { _name2type.Clear(); }
/// <summary> /// Removes all filter information from the factory. /// </summary> public static void Clear() { _filters.Clear(); }
private void ClearDictionary() { TypeDictionary.Clear(); }