public void CreatesNewObjectMethods() { _transformator.Transform(_tracker); _signer.SignAndSave(_tracker); foreach (var def in _tracker.GetModifiedAssemblies()) { foreach (var typ in def.MainModule.Types) { Assert.That(typ.Methods.Select(m => m.Name == "NewObject").Count(), Is.EqualTo(3)); Assert.That(typ.Methods.Select(m => { return(m.IsConstructor && m.IsPublic); }).Count(), Is.EqualTo(3)); } } foreach (var file in Directory.EnumerateFiles(TempPath, "*", SearchOption.AllDirectories)) { File.Delete(file); } }
public void SignAndSave(IAssemblyTracker tracker) { ArgumentUtility.CheckNotNull ("tracker", tracker); ICollection<AssemblyDefinition> assembliesToSave = new List<AssemblyDefinition> (tracker.GetModifiedAssemblies ()); while (assembliesToSave.Count != 0) { var modifiedAssembly = assembliesToSave.First(); SignAndSave (tracker, modifiedAssembly, assembliesToSave); tracker.MarkUnmodified (modifiedAssembly); } }
public void SignAndSave(IAssemblyTracker tracker) { ArgumentUtility.CheckNotNull("tracker", tracker); ICollection <AssemblyDefinition> assembliesToSave = new List <AssemblyDefinition> (tracker.GetModifiedAssemblies()); while (assembliesToSave.Count != 0) { var modifiedAssembly = assembliesToSave.First(); SignAndSave(tracker, modifiedAssembly, assembliesToSave); tracker.MarkUnmodified(modifiedAssembly); } }