commit 623335f7f8db3aff332aed6eea9e5837ba82ff25 Author: Tommy Parnell Date: Wed Mar 16 20:11:12 2016 -0400 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..af5df49 --- /dev/null +++ b/.gitignore @@ -0,0 +1,245 @@ +gnore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml diff --git a/Audi.UnitTests/Audi.UnitTests.csproj b/Audi.UnitTests/Audi.UnitTests.csproj new file mode 100644 index 0000000..dba6e26 --- /dev/null +++ b/Audi.UnitTests/Audi.UnitTests.csproj @@ -0,0 +1,88 @@ + + + + + Debug + AnyCPU + {DC86896A-67CC-42E4-96A4-CCC4C4698621} + Library + Properties + Audi.UnitTests + Audi.UnitTests + v4.5.2 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll + False + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll + False + + + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll + False + + + ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll + False + + + + + + + + + + + + + + + + + + + + {f518552f-c9bd-4bf2-b1a7-8dc107b30202} + Audi + + + + + + + + \ No newline at end of file diff --git a/Audi.UnitTests/NUnitTest.cs b/Audi.UnitTests/NUnitTest.cs new file mode 100644 index 0000000..2cae5af --- /dev/null +++ b/Audi.UnitTests/NUnitTest.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Core; +using NUnit.Core.Extensibility; +using NUnit.Framework; + +namespace Audi.UnitTests +{ + [TestFixture] + public class NUnit + { + [Test] + public void IAmAFailingTest() + { + A500.Setup(); + Assert.IsTrue(false); + } + } +} \ No newline at end of file diff --git a/Audi.UnitTests/Properties/AssemblyInfo.cs b/Audi.UnitTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..20d5449 --- /dev/null +++ b/Audi.UnitTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Audi.UnitTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Audi.UnitTests")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dc86896a-67cc-42e4-96a4-ccc4c4698621")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Audi.UnitTests/packages.config b/Audi.UnitTests/packages.config new file mode 100644 index 0000000..fba0c17 --- /dev/null +++ b/Audi.UnitTests/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Audi.sln b/Audi.sln new file mode 100644 index 0000000..1511976 --- /dev/null +++ b/Audi.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CBAF2333-2CE1-4234-9FB8-3402086A36E5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{301F199F-1409-4295-95A9-0BC4B2FF8B6B}" + ProjectSection(SolutionItems) = preProject + global.json = global.json + NuGet.Config = NuGet.Config + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Audi", "Audi\Audi.csproj", "{F518552F-C9BD-4BF2-B1A7-8DC107B30202}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Audi.UnitTests", "Audi.UnitTests\Audi.UnitTests.csproj", "{DC86896A-67CC-42E4-96A4-CCC4C4698621}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F518552F-C9BD-4BF2-B1A7-8DC107B30202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F518552F-C9BD-4BF2-B1A7-8DC107B30202}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F518552F-C9BD-4BF2-B1A7-8DC107B30202}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F518552F-C9BD-4BF2-B1A7-8DC107B30202}.Release|Any CPU.Build.0 = Release|Any CPU + {DC86896A-67CC-42E4-96A4-CCC4C4698621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC86896A-67CC-42E4-96A4-CCC4C4698621}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DC86896A-67CC-42E4-96A4-CCC4C4698621}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DC86896A-67CC-42E4-96A4-CCC4C4698621}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {F518552F-C9BD-4BF2-B1A7-8DC107B30202} = {CBAF2333-2CE1-4234-9FB8-3402086A36E5} + {DC86896A-67CC-42E4-96A4-CCC4C4698621} = {CBAF2333-2CE1-4234-9FB8-3402086A36E5} + EndGlobalSection +EndGlobal diff --git a/Audi/A500.cs b/Audi/A500.cs new file mode 100644 index 0000000..16380fd --- /dev/null +++ b/Audi/A500.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Audi +{ + public class A500 + { + internal static bool Ran { get; set; } + internal static readonly A500 Instance = new A500(); + + public delegate void StandardVoid(); + + private static Dictionary primedAssemblies = new Dictionary(); + + public static void Setup() + { + var assm = Assembly.GetCallingAssembly(); + if(primedAssemblies.ContainsKey(assm.FullName)) + { + return; + } + primedAssemblies.Add(assm.FullName, true); + assm + .GetTypes() + .SelectMany(a => a.GetMethods()) + .Where(a => a.GetCustomAttributes().Any(b => IsTest(b.GetType().Name))) + + .ToList() + .ForEach(a => + { + unsafe + { + var newMethod = new DynamicMethod("overrideMethod" + a.Name, a.ReturnType, a.GetParameters().Select(b => b.ParameterType).ToArray()); + var body = newMethod.GetILGenerator(); + body.Emit(OpCodes.Ret); + var del = Delegate.CreateDelegate(typeof(StandardVoid), Instance, "replacement"); + *((int*)new IntPtr(((int*)a.MethodHandle.Value.ToPointer() + 2)).ToPointer()) = del.Method.MethodHandle.GetFunctionPointer().ToInt32(); + } + }); + Ran = true; + } + + public void replacement() + { + return; + } + + internal static bool IsTest(string typeName) + { + var type = typeName.Contains("Test") || typeName.Contains("Fact") || typeName.Contains("Theory"); + return type; + } + } +} \ No newline at end of file diff --git a/Audi/Audi.csproj b/Audi/Audi.csproj new file mode 100644 index 0000000..163ba11 --- /dev/null +++ b/Audi/Audi.csproj @@ -0,0 +1,73 @@ + + + + + Debug + AnyCPU + {F518552F-C9BD-4BF2-B1A7-8DC107B30202} + Library + Properties + Audi + Audi + v4.5.2 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/Audi/FodyWeavers.xml b/Audi/FodyWeavers.xml new file mode 100644 index 0000000..4e845a2 --- /dev/null +++ b/Audi/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Audi/ModuleInitializer.cs b/Audi/ModuleInitializer.cs new file mode 100644 index 0000000..42b1b7d --- /dev/null +++ b/Audi/ModuleInitializer.cs @@ -0,0 +1,15 @@ +using System; +using Audi; + +/// +/// Used by the ModuleInit. All code inside the Initialize method is ran as soon as the assembly is loaded. +/// +public static class ModuleInitializer +{ + /// + /// Initializes the module. + /// + public static void Initialize() + { + } +} \ No newline at end of file diff --git a/Audi/Properties/AssemblyInfo.cs b/Audi/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..198227a --- /dev/null +++ b/Audi/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Audi")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Audi")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f518552f-c9bd-4bf2-b1a7-8dc107b30202")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Audi/packages.config b/Audi/packages.config new file mode 100644 index 0000000..881e5ec --- /dev/null +++ b/Audi/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..95143bd --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/global.json b/global.json new file mode 100644 index 0000000..0c71551 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "projects": [ "src", "test" ], + "sdk": { + "version": "1.0.0-beta8" + } +}