private static void Main(string[] args) { Console.Title = "Alloy Patcher"; var config = JObject.Parse(File.ReadAllText("config.json")); var source = Environment.ExpandEnvironmentVariables(config["SourceAssembly"].ToString()); var target = Environment.ExpandEnvironmentVariables(config["TargetAssembly"].ToString()); var targetDir = Path.GetDirectoryName(target); var refs = config["References"]; if (File.Exists(source)) { injector = new AssemblyInjector(source, target); Console.WriteLine($"Patching assembly {source}."); injector.Inject(); Console.WriteLine($"Exporting assembly to {target}."); injector.Export(); Console.WriteLine("Copying references."); foreach (var reference in refs) { File.Copy(reference.ToString(), Path.Combine(targetDir, reference.ToString()), true); } Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Done."); Thread.Sleep(1000); } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Assembly {source} not found."); Console.ReadLine(); } }
public void Initialize() { AssemblyInjector.Inject(); var appInfo = new AppInfo("test_url") { AppIconPath = "icon_path" }; _remoteContentDownloader = Substitute.For <IRemoteContentDownloader>(); _sut = new DownloadWindowViewModel(appInfo, Substitute.For <IDebuggingInfoLogger>(), _remoteContentDownloader); }
public void Initialize() { var debuggingInfoLogger = Substitute.For <IDebuggingInfoLogger>(); _analyticsLogger = Substitute.For <IAnalyticsLogger>(); var remoteContentDownloader = Substitute.For <IRemoteContentDownloader>(); var appInfo = new AppInfo("valid_url"); _channel = new MockChannel(1, "1.0"); AssemblyInjector.Inject(); _mainWindowViewModel = new MockMainWindowViewModel(appInfo, debuggingInfoLogger, remoteContentDownloader, _analyticsLogger); }
public void Initialize() { AssemblyInjector.Inject(); _mockMagpie = new MockMagpie("validContentUrl"); }
public void Initialize() { AssemblyInjector.Inject(); _analyticsLogger = Substitute.For <IAnalyticsLogger>(); _mockMagpie = new MockMagpie("validContentUrl", analyticsLogger: _analyticsLogger); }
public void Initialize() { AssemblyInjector.Inject(); }
public void TestInitialize() { AssemblyInjector.Inject(); _registryIO = Substitute.For <RegistryIO>(); _sut = new UpdateDecider(Substitute.For <IDebuggingInfoLogger>(), _registryIO); }