public void ResolveFullDomainGenericJobsTest() { var assemblyPaths = CompilationPipeline.GetAssemblies(AssembliesType.Player) .Select(a => a.outputPath); var jobResolver = new GenericResolver(assemblyPaths); var resolvedJobs = jobResolver.ResolveGenericJobs(); jobResolver.Dispose(); }
public void ResolveGenericJobsTest() { var assemblyPaths = CecilTypeUtility.GetAssemblyPaths(new[] { "Stackray.TestGenericJobs.dll" }); var jobResolver = new GenericResolver(assemblyPaths); var resolvedJobs = jobResolver.ResolveGenericJobs(); jobResolver.Dispose(); Assert.True(resolvedJobs.Count() == GenericJobs <bool, bool> .CONCRETE_UNIQUE_JOB_ENTRIES); }
public void GetGenericJobsCallsTest() { var assemblyPaths = CecilTypeUtility.GetAssemblyPaths(new[] { "Stackray.TestGenericJobs.dll" }); var jobResolver = new GenericResolver(assemblyPaths); var genericJobs = jobResolver.GetGenericJobCalls(); jobResolver.Dispose(); Assert.True(genericJobs.Count() == GenericJobs <bool, bool> .GENERIC_UNIQUE_JOB_ENTRIES); }
public void ResolveGenericCascadeCallTest() { var assemblyPaths = CecilTypeUtility.GetAssemblyPaths(new[] { "Stackray.TestGenericCascadeCall.dll" }); var jobResolver = new GenericResolver(assemblyPaths); var resolvedJobs = jobResolver.ResolveGenericJobs(); jobResolver.Dispose(); Assert.True( resolvedJobs.Count() == 1 && (resolvedJobs.First() as GenericInstanceType).GenericArguments.Count == 1 && (resolvedJobs.First() as GenericInstanceType).GenericArguments.First().Name == typeof(int).Name); }
public void ResolveGenericSystemsTest() { var assemblyPaths = CecilTypeUtility.GetAssemblyPaths(new[] { "Stackray.TestGenericSystems.dll" }); var jobResolver = new GenericResolver(assemblyPaths); var resolvedJobs = jobResolver.ResolveGenericJobs(); jobResolver.Dispose(); Assert.True( resolvedJobs.Count() == 2 && resolvedJobs.Any(job => (job as GenericInstanceType).GenericArguments.First().Name == typeof(int).Name) && resolvedJobs.Any(job => (job as GenericInstanceType).GenericArguments.First().Name == typeof(double).Name)); }
public void WriteNewAssemblyInjectionTest() { var writeAssemblyPath = AssembliesPath + "TestConcreteAssembly.dll"; var assemblyPaths = CecilTypeUtility.GetAssemblyPaths(new[] { "Stackray.TestGenericJobs.dll" }); var jobResolver = new GenericResolver(assemblyPaths); var resolvedJobs = jobResolver.ResolveGenericJobs(); jobResolver.Dispose(); var outputAssembly = CecilTypeUtility.CreateAssembly("TestConcreteJobs", resolvedJobs); outputAssembly.Write(writeAssemblyPath); var assembly = AssemblyDefinition.ReadAssembly(writeAssemblyPath); var methods = CecilTypeUtility.GetMethodDefinitions(assembly).Where(m => m.FullName.Contains("TestConcreteJobs")); assembly.Dispose(); Assert.True(methods.Any()); }