private IEnumerable <(Type Original, Type Abstraction)> GetTypes() { foreach (var originalType in _originalTypes) { if (CustomTypeMappings.TryGet(originalType, out var abstractionTypes)) { foreach (var abstractionType in abstractionTypes) { yield return(originalType, abstractionType); } } else { if (ExcludedTypes.Contains(originalType)) { continue; } if (ExcludeTypeCallback?.Invoke(originalType) == true) { continue; } var abstractionTypeName = BuildAbstractionTypeName(originalType); var abstractionType = _abstractionTypes.FirstOrDefault(t => t.FullName == abstractionTypeName); yield return(originalType, abstractionType); } } }
public IntegrityTests() : base("Threading.Tasks") { ExcludedTypes.Add(typeof(AsyncTaskMethodBuilder)); ExcludedTypes.Add(typeof(AsyncVoidMethodBuilder)); ExcludedTypes.Add(typeof(ConfiguredTaskAwaitable)); ExcludedTypes.Add(typeof(ConfiguredTaskAwaitable <>)); ExcludedTypes.Add(typeof(TaskAwaiter)); ExcludedTypes.Add(typeof(TaskAwaiter <>)); ExcludedTypes.Add(typeof(YieldAwaitable)); ExcludedTypes.Add(typeof(CancellationToken)); ExcludedTypes.Add(typeof(CancellationTokenRegistration)); ExcludedTypes.Add(typeof(CancellationTokenSource)); ExcludedTypes.Add(typeof(ConcurrentExclusiveSchedulerPair)); ExcludedTypes.Add(typeof(TaskCompletionSource <>)); ExcludedTypes.Add(typeof(TaskScheduler)); ExcludedTypes.Add(typeof(UnobservedTaskExceptionEventArgs)); ExcludedTypes.Add(typeof(AsyncTaskMethodBuilder <>)); ExcludedTypes.Add(typeof(IAsyncTaskMethodBuilder <>)); ExcludedTypes.Add(typeof(IAsyncTaskMethodBuilder <,>)); CustomTypeMappings.Add(typeof(System.Threading.Tasks.TaskExtensions), typeof(TaskExtensions)); CustomTypeMappings.Add(typeof(Task), typeof(ITask), typeof(ITaskGlobals)); CustomTypeMappings.Add(typeof(Task <>), typeof(ITask <>), typeof(ITaskGlobals <>)); ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("Net.Primitives") { ExcludedTypes.Add(typeof(CookieException)); ExcludedTypes.Add(typeof(SocketException)); ExcludedTypes.Add(typeof(HttpVersion)); ExcludedTypes.Add(Type.GetType("System.Net.PathList, System.Net.Primitives, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")); // exists in netcoreapp only CustomTypeMappings.Add(typeof(IPAddress), new List <Type> { typeof(IIPAddress), typeof(IIPAddressGlobals) }); CustomTypeMappings.Add(typeof(IPEndPoint), new List <Type> { typeof(IIPEndPoint), typeof(IIPEndPointGlobals) }); ExcludeMember <CookieContainer>(nameof(CookieContainer.DefaultCookieLimit)); ExcludeMember <CookieContainer>(nameof(CookieContainer.DefaultPerDomainCookieLimit)); ExcludeMember <CookieContainer>(nameof(CookieContainer.DefaultCookieLengthLimit)); ExcludeMember <CredentialCache>(nameof(CredentialCache.DefaultCredentials)); ExcludeMember <CredentialCache>(nameof(CredentialCache.DefaultNetworkCredentials)); ExcludeMember <IPEndPoint>(nameof(IPEndPoint.MinPort)); ExcludeMember <IPEndPoint>(nameof(IPEndPoint.MaxPort)); #pragma warning disable 618 ExcludeMember <IPAddress>(nameof(IPAddress.Address)); // deprecated #pragma warning restore 618 ExcludeMemberCallback = Exclude; }
public IntegrityTests() : base("Console") { CustomTypeMappings.Add(typeof(ConsoleCancelEventHandler), typeof(EventHandler <IConsoleCancelEventArgs>)); ExcludedTypes.Add(typeof(ConsoleKeyInfo)); // struct ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); }
public IntegrityTests() : base("Net.NetworkInformation") { ExcludedTypes.Add(typeof(IcmpV4Statistics)); // abstract class ExcludedTypes.Add(typeof(IcmpV6Statistics)); // abstract class ExcludedTypes.Add(typeof(IPGlobalProperties)); // abstract class ExcludedTypes.Add(typeof(IPGlobalStatistics)); // abstract class ExcludedTypes.Add(typeof(IPv4InterfaceStatistics)); // abstract class ExcludedTypes.Add(typeof(TcpConnectionInformation)); // abstract class ExcludedTypes.Add(typeof(TcpStatistics)); // abstract class ExcludedTypes.Add(typeof(UdpStatistics)); // abstract class ExcludedTypes.Add(typeof(NetworkInformationException)); CustomTypeMappings.Add(typeof(NetworkAddressChangedEventHandler), typeof(EventHandler)); CustomTypeMappings.Add(typeof(NetworkAvailabilityChangedEventHandler), typeof(EventHandler <INetworkAvailabilityEventArgs>)); CustomTypeMappings.Add(typeof(NetworkInterface), new List <Type> { typeof(INetworkInterface), typeof(INetworkInterfaceGlobals) }); CustomTypeMappings.Add(typeof(PhysicalAddress), new List <Type> { typeof(IPhysicalAddress), typeof(IPhysicalAddressGlobals) }); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeMember <NetworkChange>("RegisterNetworkChange"); // deprecated ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("Runtime.Extensions") { ExcludedTypes.Add(typeof(AssemblyLoadEventArgs)); ExcludedTypes.Add(typeof(AssemblyLoadEventHandler)); ExcludedTypes.Add(typeof(MathF)); ExcludedTypes.Add(typeof(Progress <>)); ExcludedTypes.Add(typeof(ResolveEventHandler)); ExcludedTypes.Add(typeof(StringComparer)); ExcludedTypes.Add(typeof(AppDomain)); ExcludedTypes.Add(typeof(ApplicationId)); ExcludedTypes.Add(typeof(ContextBoundObject)); ExcludedTypes.Add(typeof(ContextStaticAttribute)); ExcludedTypes.Add(typeof(LoaderOptimizationAttribute)); ExcludedTypes.Add(typeof(OperatingSystem)); ExcludedTypes.Add(typeof(StringNormalizationExtensions)); ExcludedTypes.Add(typeof(SecurityElement)); ExcludedTypes.Add(typeof(CodeAccessSecurityAttribute)); ExcludedTypes.Add(typeof(SecurityAttribute)); ExcludedTypes.Add(typeof(SecurityPermissionAttribute)); ExcludedTypes.Add(typeof(ArrayList)); ExcludedTypes.Add(typeof(Comparer)); ExcludedTypes.Add(typeof(Hashtable)); ExcludedTypes.Add(typeof(FrameworkName)); ExcludedTypes.Add(typeof(ComponentGuaranteesAttribute)); ExcludedTypes.Add(typeof(ResourceConsumptionAttribute)); ExcludedTypes.Add(typeof(ResourceExposureAttribute)); ExcludedTypes.Add(typeof(VersioningHelper)); ExcludedTypes.Add(typeof(AssemblyNameProxy)); ExcludedTypes.Add(typeof(GlobalizationExtensions)); ExcludedTypes.Add(typeof(BinaryReader)); // IO ExcludedTypes.Add(typeof(BinaryWriter)); // IO ExcludedTypes.Add(typeof(MemoryStream)); // IO ExcludedTypes.Add(typeof(BufferedStream)); // IO ExcludedTypes.Add(typeof(IndentedTextWriter)); // IO ExcludedTypes.Add(typeof(StreamReader)); // IO ExcludedTypes.Add(typeof(StreamWriter)); // IO ExcludedTypes.Add(typeof(StringReader)); // IO ExcludedTypes.Add(typeof(StringWriter)); // IO ExcludedTypes.Add(typeof(TextReader)); // IO ExcludedTypes.Add(typeof(TextWriter)); // IO CustomTypeMappings.Add(typeof(Stopwatch), new List <Type> { typeof(IStopwatch), typeof(IStopwatchGlobals) }); #pragma warning disable 618 ExcludeMembers(typeof(Path), nameof(Path.InvalidPathChars)); // deprecated #pragma warning restore 618 ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("Text.Encoding") { ExcludedTypes.Add(typeof(DecoderFallback)); ExcludedTypes.Add(typeof(DecoderFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderReplacementFallback)); ExcludedTypes.Add(typeof(DecoderExceptionFallback)); ExcludedTypes.Add(typeof(EncoderFallback)); ExcludedTypes.Add(typeof(EncoderFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderReplacementFallback)); ExcludedTypes.Add(typeof(EncoderExceptionFallback)); ExcludedTypes.Add(typeof(EncodingProvider)); CustomTypeMappings.Add(typeof(Encoding), new List <Type> { typeof(IEncoding), typeof(IEncodingGlobals) }); ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("Runtime") { ExcludedTypes.Add(typeof(GCHandle)); ExcludedTypes.Add(typeof(CriticalHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(CriticalHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(object)); ExcludedTypes.Add(typeof(string)); ExcludedTypes.Add(typeof(Enum)); ExcludedTypes.Add(typeof(Array)); ExcludedTypes.Add(typeof(Nullable)); ExcludedTypes.Add(typeof(Lazy <>)); ExcludedTypes.Add(typeof(Lazy <,>)); ExcludedTypes.Add(typeof(Pointer)); #pragma warning disable 618, SYSLIB0003 ExcludedTypes.Add(typeof(TimeZone)); // deprecated ExcludedTypes.Add(typeof(System.Security.PermissionSet)); // obsolete #pragma warning restore 618, SYSLIB0003 ExcludedTypes.Add(typeof(Activator)); ExcludedTypes.Add(typeof(AppContext)); ExcludedTypes.Add(typeof(ArraySegment <>)); ExcludedTypes.Add(typeof(AsyncCallback)); ExcludedTypes.Add(typeof(Buffer)); ExcludedTypes.Add(typeof(CharEnumerator)); ExcludedTypes.Add(typeof(KeyValuePair)); ExcludedTypes.Add(typeof(Collection <>)); ExcludedTypes.Add(typeof(ReadOnlyCollection <>)); ExcludedTypes.Add(typeof(DBNull)); ExcludedTypes.Add(typeof(FormattableString)); ExcludedTypes.Add(typeof(FileStyleUriParser)); ExcludedTypes.Add(typeof(FtpStyleUriParser)); ExcludedTypes.Add(typeof(GenericUriParser)); ExcludedTypes.Add(typeof(GC)); ExcludedTypes.Add(typeof(CharUnicodeInfo)); ExcludedTypes.Add(typeof(CompareInfo)); ExcludedTypes.Add(typeof(CultureInfo)); ExcludedTypes.Add(typeof(DateTimeFormatInfo)); ExcludedTypes.Add(typeof(DaylightTime)); ExcludedTypes.Add(typeof(IdnMapping)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(RegionInfo)); ExcludedTypes.Add(typeof(SortKey)); ExcludedTypes.Add(typeof(SortVersion)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(StringInfo)); ExcludedTypes.Add(typeof(TextElementEnumerator)); ExcludedTypes.Add(typeof(TextInfo)); ExcludedTypes.Add(typeof(GopherStyleUriParser)); ExcludedTypes.Add(typeof(HttpStyleUriParser)); ExcludedTypes.Add(typeof(LdapStyleUriParser)); ExcludedTypes.Add(typeof(MarshalByRefObject)); ExcludedTypes.Add(typeof(NetPipeStyleUriParser)); ExcludedTypes.Add(typeof(NetTcpStyleUriParser)); ExcludedTypes.Add(typeof(NewsStyleUriParser)); ExcludedTypes.Add(typeof(Assembly)); ExcludedTypes.Add(typeof(AssemblyName)); ExcludedTypes.Add(typeof(Binder)); ExcludedTypes.Add(typeof(ConstructorInfo)); ExcludedTypes.Add(typeof(CustomAttributeData)); ExcludedTypes.Add(typeof(CustomAttributeExtensions)); ExcludedTypes.Add(typeof(EventInfo)); ExcludedTypes.Add(typeof(ExceptionHandlingClause)); ExcludedTypes.Add(typeof(FieldInfo)); ExcludedTypes.Add(typeof(IntrospectionExtensions)); ExcludedTypes.Add(typeof(LocalVariableInfo)); ExcludedTypes.Add(typeof(ManifestResourceInfo)); ExcludedTypes.Add(typeof(MemberInfo)); ExcludedTypes.Add(typeof(MethodBase)); ExcludedTypes.Add(typeof(MethodBody)); ExcludedTypes.Add(typeof(MethodInfo)); ExcludedTypes.Add(typeof(Missing)); ExcludedTypes.Add(typeof(Module)); ExcludedTypes.Add(typeof(ParameterInfo)); ExcludedTypes.Add(typeof(PropertyInfo)); ExcludedTypes.Add(typeof(ReflectionContext)); ExcludedTypes.Add(typeof(StrongNameKeyPair)); ExcludedTypes.Add(typeof(TypeDelegator)); ExcludedTypes.Add(typeof(TypeInfo)); ExcludedTypes.Add(typeof(ResolveEventArgs)); ExcludedTypes.Add(typeof(ConditionalWeakTable <,>)); ExcludedTypes.Add(typeof(FormattableStringFactory)); ExcludedTypes.Add(typeof(IsConst)); ExcludedTypes.Add(typeof(IsVolatile)); ExcludedTypes.Add(typeof(RuntimeFeature)); ExcludedTypes.Add(typeof(RuntimeHelpers)); ExcludedTypes.Add(typeof(StrongBox <>)); ExcludedTypes.Add(typeof(CriticalFinalizerObject)); ExcludedTypes.Add(typeof(ExceptionDispatchInfo)); ExcludedTypes.Add(typeof(FirstChanceExceptionEventArgs)); ExcludedTypes.Add(typeof(GCSettings)); ExcludedTypes.Add(typeof(CriticalHandle)); ExcludedTypes.Add(typeof(MemoryFailPoint)); ExcludedTypes.Add(typeof(SafeSerializationEventArgs)); ExcludedTypes.Add(typeof(SerializationInfo)); ExcludedTypes.Add(typeof(SerializationInfoEnumerator)); ExcludedTypes.Add(typeof(Decoder)); ExcludedTypes.Add(typeof(DecoderExceptionFallback)); ExcludedTypes.Add(typeof(DecoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderFallback)); ExcludedTypes.Add(typeof(DecoderFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderReplacementFallback)); ExcludedTypes.Add(typeof(DecoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderExceptionFallback)); ExcludedTypes.Add(typeof(EncoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderFallback)); ExcludedTypes.Add(typeof(EncoderFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderReplacementFallback)); ExcludedTypes.Add(typeof(EncoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncodingInfo)); ExcludedTypes.Add(typeof(EncodingProvider)); ExcludedTypes.Add(typeof(TaskScheduler)); ExcludedTypes.Add(typeof(UnobservedTaskExceptionEventArgs)); ExcludedTypes.Add(typeof(Timeout)); ExcludedTypes.Add(typeof(WaitHandle)); ExcludedTypes.Add(typeof(TimeZoneInfo)); ExcludedTypes.Add(typeof(Type)); ExcludedTypes.Add(typeof(UnhandledExceptionEventArgs)); ExcludedTypes.Add(typeof(Uri)); ExcludedTypes.Add(typeof(UriParser)); ExcludedTypes.Add(typeof(ValueType)); ExcludedTypes.Add(typeof(Version)); ExcludedTypes.Add(typeof(WeakReference)); ExcludedTypes.Add(typeof(WeakReference <>)); ExcludedTypes.Add(typeof(WaitHandleExtensions)); ExcludedTypes.Add(typeof(RuntimeReflectionExtensions)); ExcludedTypes.Add(typeof(Calendar)); ExcludedTypes.Add(typeof(ChineseLunisolarCalendar)); ExcludedTypes.Add(typeof(EastAsianLunisolarCalendar)); ExcludedTypes.Add(typeof(GregorianCalendar)); ExcludedTypes.Add(typeof(HebrewCalendar)); ExcludedTypes.Add(typeof(HijriCalendar)); ExcludedTypes.Add(typeof(JapaneseCalendar)); ExcludedTypes.Add(typeof(JapaneseLunisolarCalendar)); ExcludedTypes.Add(typeof(JulianCalendar)); ExcludedTypes.Add(typeof(KoreanCalendar)); ExcludedTypes.Add(typeof(KoreanLunisolarCalendar)); ExcludedTypes.Add(typeof(PersianCalendar)); ExcludedTypes.Add(typeof(TaiwanCalendar)); ExcludedTypes.Add(typeof(TaiwanLunisolarCalendar)); ExcludedTypes.Add(typeof(ThaiBuddhistCalendar)); ExcludedTypes.Add(typeof(UmAlQuraCalendar)); ExcludedTypes.Add(typeof(Task)); // Threading.Tasks ExcludedTypes.Add(typeof(Task <>)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory <>)); // Threading.Tasks ExcludedTypes.Add(typeof(FileStream)); // IO.FileSystem ExcludedTypes.Add(typeof(Stream)); // IO ExcludedTypes.Add(typeof(SafeFileHandle)); // IO.FileSystem ExcludedTypes.Add(typeof(SafeWaitHandle)); // Runtime.Handles ExcludedTypes.Add(typeof(SafeHandle)); ExcludedTypes.Add(typeof(Encoding)); // Text.Encoding ExcludedTypes.Add(typeof(Encoder)); // Text.Encoding ExcludedTypes.Add(typeof(MemoryManager <>)); ExcludedTypes.Add(typeof(AssemblyLoadEventArgs)); ExcludedTypes.Add(typeof(BitConverter)); ExcludedTypes.Add(typeof(ArrayPool <>)); ExcludedTypes.Add(typeof(System.CodeDom.Compiler.IndentedTextWriter)); ExcludedTypes.Add(typeof(System.Collections.ArrayList)); ExcludedTypes.Add(typeof(System.Collections.Comparer)); ExcludedTypes.Add(typeof(System.Collections.Hashtable)); ExcludedTypes.Add(typeof(ContextBoundObject)); ExcludedTypes.Add(typeof(Convert)); ExcludedTypes.Add(typeof(System.Diagnostics.Debug)); ExcludedTypes.Add(typeof(System.Diagnostics.Debugger)); ExcludedTypes.Add(typeof(System.Diagnostics.Stopwatch)); ExcludedTypes.Add(typeof(Environment)); ExcludedTypes.Add(typeof(GlobalizationExtensions)); ExcludedTypes.Add(typeof(ISOWeek)); ExcludedTypes.Add(typeof(BinaryReader)); ExcludedTypes.Add(typeof(BinaryWriter)); ExcludedTypes.Add(typeof(BufferedStream)); ExcludedTypes.Add(typeof(MemoryStream)); ExcludedTypes.Add(typeof(Path)); ExcludedTypes.Add(typeof(StreamReader)); ExcludedTypes.Add(typeof(StreamWriter)); ExcludedTypes.Add(typeof(StringReader)); ExcludedTypes.Add(typeof(StringWriter)); ExcludedTypes.Add(typeof(TextReader)); ExcludedTypes.Add(typeof(TextWriter)); ExcludedTypes.Add(typeof(UnmanagedMemoryStream)); ExcludedTypes.Add(typeof(Math)); ExcludedTypes.Add(typeof(MathF)); ExcludedTypes.Add(typeof(System.Net.WebUtility)); ExcludedTypes.Add(typeof(System.Numerics.BitOperations)); ExcludedTypes.Add(typeof(OperatingSystem)); ExcludedTypes.Add(typeof(Progress <>)); ExcludedTypes.Add(typeof(Random)); ExcludedTypes.Add(typeof(AssemblyNameProxy)); ExcludedTypes.Add(typeof(System.Resources.ResourceManager)); ExcludedTypes.Add(typeof(System.Resources.ResourceReader)); ExcludedTypes.Add(typeof(System.Resources.ResourceSet)); ExcludedTypes.Add(typeof(CallConvCdecl)); ExcludedTypes.Add(typeof(CallConvFastcall)); ExcludedTypes.Add(typeof(CallConvStdcall)); ExcludedTypes.Add(typeof(CallConvThiscall)); ExcludedTypes.Add(typeof(IsExternalInit)); ExcludedTypes.Add(typeof(SafeBuffer)); ExcludedTypes.Add(typeof(ProfileOptimization)); ExcludedTypes.Add(typeof(System.Runtime.Remoting.ObjectHandle)); ExcludedTypes.Add(typeof(System.Runtime.Versioning.FrameworkName)); ExcludedTypes.Add(typeof(System.Runtime.Versioning.VersioningHelper)); ExcludedTypes.Add(typeof(System.Security.SecurityElement)); ExcludedTypes.Add(typeof(StringComparer)); ExcludedTypes.Add(typeof(StringNormalizationExtensions)); ExcludedTypes.Add(typeof(System.Text.Unicode.Utf8)); ExcludedTypes.Add(typeof(CancellationTokenSource)); ExcludedTypes.Add(typeof(ConcurrentExclusiveSchedulerPair)); ExcludedTypes.Add(typeof(TaskAsyncEnumerableExtensions)); ExcludedTypes.Add(typeof(TaskCompletionSource <>)); ExcludedTypes.Add(typeof(TaskExtensions)); ExcludedTypes.Add(typeof(Timer)); ExcludedTypes.Add(typeof(UriBuilder)); ExcludedTypes.Add(typeof(AppDomainSetup)); ExcludedTypes.Add(typeof(ApplicationId)); ExcludedTypes.Add(typeof(AssemblyLoadEventArgs)); ExcludedTypes.Add(typeof(BitConverter)); ExcludedTypes.Add(typeof(ArrayPool <>)); ExcludedTypes.Add(typeof(System.CodeDom.Compiler.IndentedTextWriter)); ExcludedTypes.Add(typeof(System.Collections.ArrayList)); ExcludedTypes.Add(typeof(System.Collections.Comparer)); ExcludedTypes.Add(typeof(System.Collections.Hashtable)); ExcludedTypes.Add(typeof(ContextBoundObject)); ExcludedTypes.Add(typeof(Convert)); ExcludedTypes.Add(typeof(System.Diagnostics.Debug)); ExcludedTypes.Add(typeof(System.Diagnostics.Debugger)); ExcludedTypes.Add(typeof(System.Diagnostics.Stopwatch)); ExcludedTypes.Add(typeof(Environment)); ExcludedTypes.Add(typeof(GlobalizationExtensions)); ExcludedTypes.Add(typeof(ISOWeek)); ExcludedTypes.Add(typeof(BinaryReader)); ExcludedTypes.Add(typeof(BinaryWriter)); ExcludedTypes.Add(typeof(BufferedStream)); ExcludedTypes.Add(typeof(MemoryStream)); ExcludedTypes.Add(typeof(Path)); ExcludedTypes.Add(typeof(StreamReader)); ExcludedTypes.Add(typeof(StreamWriter)); ExcludedTypes.Add(typeof(StringReader)); ExcludedTypes.Add(typeof(StringWriter)); ExcludedTypes.Add(typeof(TextReader)); ExcludedTypes.Add(typeof(TextWriter)); ExcludedTypes.Add(typeof(UnmanagedMemoryStream)); ExcludedTypes.Add(typeof(Math)); ExcludedTypes.Add(typeof(MathF)); ExcludedTypes.Add(typeof(AppDomain)); #if NET5_0 ExcludedTypes.Add(typeof(TaskCompletionSource)); #endif CustomTypeMappings.Add(typeof(DateTime), typeof(IDateTimeGlobals)); CustomTypeMappings.Add(typeof(Guid), typeof(IGuidGlobals)); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeTypeCallback = ExcludeType; ExcludeMemberCallback = ExcludeMember; }
public void MapType <T>(Func <Schema> schemaFactory) { CustomTypeMappings.Add(typeof(T), schemaFactory); }
public IntegrityTests() : base("Net.Sockets") { ExcludedTypes.Add(typeof(SocketReceiveFromResult)); ExcludedTypes.Add(typeof(SocketReceiveMessageFromResult)); ExcludedTypes.Add(typeof(SocketInformation)); ExcludedTypes.Add(typeof(IPPacketInformation)); ExcludedTypes.Add(typeof(UdpReceiveResult)); ExcludedTypes.Add(typeof(MulticastOption)); ExcludedTypes.Add(typeof(IPv6MulticastOption)); ExcludedTypes.Add(typeof(SafeSocketHandle)); CustomTypeMappings.Add(typeof(SocketTaskExtensions), typeof(SocketExtensions)); CustomTypeMappings.Add(typeof(Socket), new List <Type> { typeof(ISocket), typeof(ISocketGlobals) }); ExcludeMember <NetworkStream>(nameof(NetworkStream.BeginRead)); ExcludeMember <NetworkStream>(nameof(NetworkStream.EndRead)); ExcludeMember <NetworkStream>(nameof(NetworkStream.BeginWrite)); ExcludeMember <NetworkStream>(nameof(NetworkStream.EndWrite)); ExcludeMembers <Socket>(nameof(Socket.BeginReceive)); ExcludeMembers <Socket>(nameof(Socket.EndReceive)); ExcludeMembers <Socket>(nameof(Socket.BeginAccept)); ExcludeMembers <Socket>(nameof(Socket.EndAccept)); ExcludeMembers <Socket>(nameof(Socket.BeginConnect)); ExcludeMembers <Socket>(nameof(Socket.EndConnect)); ExcludeMember <Socket>(nameof(Socket.BeginReceiveMessageFrom)); ExcludeMember <Socket>(nameof(Socket.EndReceiveMessageFrom)); ExcludeMember <Socket>(nameof(Socket.BeginDisconnect)); ExcludeMember <Socket>(nameof(Socket.EndDisconnect)); ExcludeMember <Socket>(nameof(Socket.BeginReceiveFrom)); ExcludeMember <Socket>(nameof(Socket.EndReceiveFrom)); ExcludeMembers <Socket>(nameof(Socket.BeginSend)); ExcludeMembers <Socket>(nameof(Socket.EndSend)); ExcludeMember <Socket>(nameof(Socket.BeginSendTo)); ExcludeMember <Socket>(nameof(Socket.EndSendTo)); ExcludeMembers <Socket>(nameof(Socket.BeginSendFile)); ExcludeMembers <Socket>(nameof(Socket.EndSendFile)); ExcludeMembers <TcpClient>(nameof(TcpClient.BeginConnect)); ExcludeMembers <TcpClient>(nameof(TcpClient.EndConnect)); ExcludeMembers <TcpListener>(nameof(TcpListener.BeginAcceptSocket)); ExcludeMembers <TcpListener>(nameof(TcpListener.EndAcceptSocket)); ExcludeMembers <TcpListener>(nameof(TcpListener.BeginAcceptTcpClient)); ExcludeMembers <TcpListener>(nameof(TcpListener.EndAcceptTcpClient)); ExcludeMembers <UdpClient>(nameof(UdpClient.BeginSend)); ExcludeMembers <UdpClient>(nameof(UdpClient.EndSend)); ExcludeMembers <UdpClient>(nameof(UdpClient.BeginReceive)); ExcludeMembers <UdpClient>(nameof(UdpClient.EndReceive)); #pragma warning disable 618 ExcludeMembers <Socket>(nameof(Socket.SupportsIPv4)); // deprecated ExcludeMembers <Socket>(nameof(Socket.SupportsIPv6)); // deprecated #pragma warning restore 618 ExcludeMember <Stream>(nameof(Stream.Synchronized)); ExcludeMember <Stream>(nameof(Stream.Null)); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeMemberCallback = Exclude; }
public IntegrityTests() : base("Runtime") { ExcludedTypes.Add(typeof(GCHandle)); ExcludedTypes.Add(typeof(CriticalHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(CriticalHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(object)); ExcludedTypes.Add(typeof(string)); ExcludedTypes.Add(typeof(Enum)); ExcludedTypes.Add(typeof(Array)); ExcludedTypes.Add(typeof(Nullable)); ExcludedTypes.Add(typeof(Lazy <>)); ExcludedTypes.Add(typeof(Lazy <,>)); ExcludedTypes.Add(typeof(Pointer)); #pragma warning disable 618 ExcludedTypes.Add(typeof(TimeZone)); // deprecated #pragma warning restore 618 ExcludedTypes.Add(typeof(Activator)); ExcludedTypes.Add(typeof(AppContext)); ExcludedTypes.Add(typeof(ArraySegment <>)); ExcludedTypes.Add(typeof(AsyncCallback)); ExcludedTypes.Add(typeof(Buffer)); ExcludedTypes.Add(typeof(CharEnumerator)); ExcludedTypes.Add(typeof(KeyValuePair)); ExcludedTypes.Add(typeof(Collection <>)); ExcludedTypes.Add(typeof(ReadOnlyCollection <>)); ExcludedTypes.Add(typeof(DBNull)); ExcludedTypes.Add(typeof(FormattableString)); ExcludedTypes.Add(typeof(FileStyleUriParser)); ExcludedTypes.Add(typeof(FtpStyleUriParser)); ExcludedTypes.Add(typeof(GenericUriParser)); ExcludedTypes.Add(typeof(GC)); ExcludedTypes.Add(typeof(CharUnicodeInfo)); ExcludedTypes.Add(typeof(CompareInfo)); ExcludedTypes.Add(typeof(CultureInfo)); ExcludedTypes.Add(typeof(DateTimeFormatInfo)); ExcludedTypes.Add(typeof(DaylightTime)); ExcludedTypes.Add(typeof(IdnMapping)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(RegionInfo)); ExcludedTypes.Add(typeof(SortKey)); ExcludedTypes.Add(typeof(SortVersion)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(StringInfo)); ExcludedTypes.Add(typeof(TextElementEnumerator)); ExcludedTypes.Add(typeof(TextInfo)); ExcludedTypes.Add(typeof(GopherStyleUriParser)); ExcludedTypes.Add(typeof(HttpStyleUriParser)); ExcludedTypes.Add(typeof(LdapStyleUriParser)); ExcludedTypes.Add(typeof(MarshalByRefObject)); ExcludedTypes.Add(typeof(NetPipeStyleUriParser)); ExcludedTypes.Add(typeof(NetTcpStyleUriParser)); ExcludedTypes.Add(typeof(NewsStyleUriParser)); ExcludedTypes.Add(typeof(Assembly)); ExcludedTypes.Add(typeof(AssemblyName)); ExcludedTypes.Add(typeof(Binder)); ExcludedTypes.Add(typeof(ConstructorInfo)); ExcludedTypes.Add(typeof(CustomAttributeData)); ExcludedTypes.Add(typeof(CustomAttributeExtensions)); ExcludedTypes.Add(typeof(EventInfo)); ExcludedTypes.Add(typeof(ExceptionHandlingClause)); ExcludedTypes.Add(typeof(FieldInfo)); ExcludedTypes.Add(typeof(IntrospectionExtensions)); ExcludedTypes.Add(typeof(LocalVariableInfo)); ExcludedTypes.Add(typeof(ManifestResourceInfo)); ExcludedTypes.Add(typeof(MemberInfo)); ExcludedTypes.Add(typeof(MethodBase)); ExcludedTypes.Add(typeof(MethodBody)); ExcludedTypes.Add(typeof(MethodInfo)); ExcludedTypes.Add(typeof(Missing)); ExcludedTypes.Add(typeof(Module)); ExcludedTypes.Add(typeof(ParameterInfo)); ExcludedTypes.Add(typeof(PropertyInfo)); ExcludedTypes.Add(typeof(ReflectionContext)); ExcludedTypes.Add(typeof(StrongNameKeyPair)); ExcludedTypes.Add(typeof(TypeDelegator)); ExcludedTypes.Add(typeof(TypeInfo)); ExcludedTypes.Add(typeof(ResolveEventArgs)); ExcludedTypes.Add(typeof(ConditionalWeakTable <,>)); ExcludedTypes.Add(typeof(FormattableStringFactory)); ExcludedTypes.Add(typeof(IsConst)); ExcludedTypes.Add(typeof(IsVolatile)); ExcludedTypes.Add(typeof(RuntimeFeature)); ExcludedTypes.Add(typeof(RuntimeHelpers)); ExcludedTypes.Add(typeof(StrongBox <>)); ExcludedTypes.Add(typeof(CriticalFinalizerObject)); ExcludedTypes.Add(typeof(ExceptionDispatchInfo)); ExcludedTypes.Add(typeof(FirstChanceExceptionEventArgs)); ExcludedTypes.Add(typeof(GCSettings)); ExcludedTypes.Add(typeof(CriticalHandle)); ExcludedTypes.Add(typeof(MemoryFailPoint)); ExcludedTypes.Add(typeof(SafeSerializationEventArgs)); ExcludedTypes.Add(typeof(SerializationInfo)); ExcludedTypes.Add(typeof(SerializationInfoEnumerator)); ExcludedTypes.Add(typeof(Decoder)); ExcludedTypes.Add(typeof(DecoderExceptionFallback)); ExcludedTypes.Add(typeof(DecoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderFallback)); ExcludedTypes.Add(typeof(DecoderFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderReplacementFallback)); ExcludedTypes.Add(typeof(DecoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderExceptionFallback)); ExcludedTypes.Add(typeof(EncoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderFallback)); ExcludedTypes.Add(typeof(EncoderFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderReplacementFallback)); ExcludedTypes.Add(typeof(EncoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncodingInfo)); ExcludedTypes.Add(typeof(EncodingProvider)); ExcludedTypes.Add(typeof(TaskScheduler)); ExcludedTypes.Add(typeof(UnobservedTaskExceptionEventArgs)); ExcludedTypes.Add(typeof(Timeout)); ExcludedTypes.Add(typeof(WaitHandle)); ExcludedTypes.Add(typeof(TimeZoneInfo)); ExcludedTypes.Add(typeof(Type)); ExcludedTypes.Add(typeof(UnhandledExceptionEventArgs)); ExcludedTypes.Add(typeof(Uri)); ExcludedTypes.Add(typeof(UriParser)); ExcludedTypes.Add(typeof(ValueType)); ExcludedTypes.Add(typeof(Version)); ExcludedTypes.Add(typeof(WeakReference)); ExcludedTypes.Add(typeof(WeakReference <>)); ExcludedTypes.Add(typeof(WaitHandleExtensions)); ExcludedTypes.Add(typeof(RuntimeReflectionExtensions)); ExcludedTypes.Add(typeof(Calendar)); ExcludedTypes.Add(typeof(ChineseLunisolarCalendar)); ExcludedTypes.Add(typeof(EastAsianLunisolarCalendar)); ExcludedTypes.Add(typeof(GregorianCalendar)); ExcludedTypes.Add(typeof(HebrewCalendar)); ExcludedTypes.Add(typeof(HijriCalendar)); ExcludedTypes.Add(typeof(JapaneseCalendar)); ExcludedTypes.Add(typeof(JapaneseLunisolarCalendar)); ExcludedTypes.Add(typeof(JulianCalendar)); ExcludedTypes.Add(typeof(KoreanCalendar)); ExcludedTypes.Add(typeof(KoreanLunisolarCalendar)); ExcludedTypes.Add(typeof(PersianCalendar)); ExcludedTypes.Add(typeof(TaiwanCalendar)); ExcludedTypes.Add(typeof(TaiwanLunisolarCalendar)); ExcludedTypes.Add(typeof(ThaiBuddhistCalendar)); ExcludedTypes.Add(typeof(UmAlQuraCalendar)); ExcludedTypes.Add(typeof(Task)); // Threading.Tasks ExcludedTypes.Add(typeof(Task <>)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory <>)); // Threading.Tasks ExcludedTypes.Add(typeof(FileStream)); // IO.FileSystem ExcludedTypes.Add(typeof(Stream)); // IO ExcludedTypes.Add(typeof(SafeFileHandle)); // IO.FileSystem ExcludedTypes.Add(typeof(SafeWaitHandle)); // Runtime.Handles ExcludedTypes.Add(typeof(SafeHandle)); ExcludedTypes.Add(typeof(Encoding)); // Text.Encoding ExcludedTypes.Add(typeof(Encoder)); // Text.Encoding ExcludedTypes.Add(typeof(MemoryManager <>)); CustomTypeMappings.Add(typeof(DateTime), typeof(IDateTimeGlobals)); CustomTypeMappings.Add(typeof(Guid), typeof(IGuidGlobals)); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeTypeCallback = ExcludeType; ExcludeMemberCallback = ExcludeMember; }