Skip to content

Commit

Permalink
hotfix for #250
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Soltenborn committed Dec 10, 2018
1 parent 2095af6 commit c54794d
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions GoogleTestAdapter/Common/Strings.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System;
using System.IO;
using System.Reflection;

namespace GoogleTestAdapter.Common
{
public class Strings
{
private static IStrings _strings;
public class Strings : IStrings
{
private static readonly IStrings _strings;

static Strings()
{
_strings = new Strings();

// this is broken since 0.14.0 for reasons I don't understand. Switching to fixed GTA strings for now...
// var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "GoogleTestAdapter.Common.Dynamic.dll");
// var asm = Assembly.LoadFile(path);
// var type = asm.GetType("GoogleTestAdapter.Common.Strings");
// _strings = (IStrings)Activator.CreateInstance(type);
}

public static IStrings Instance => _strings;

static Strings()
{
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "GoogleTestAdapter.Common.Dynamic.dll");
var asm = Assembly.LoadFile(path);
var type = asm.GetType("GoogleTestAdapter.Common.Strings");
_strings = (IStrings)Activator.CreateInstance(type);
}
public string ExtensionName => "Google Test Adapter";
public string TroubleShootingLink => "Check out Google Test Adapter's trouble shooting section at https://github.com/csoltenborn/GoogleTestAdapter#trouble_shooting";
public string TestDiscoveryStarting => "Google Test Adapter: Test discovery starting...";
public string TestExecutionStarting => "Google Test Adapter: Test execution starting...";

public static IStrings Instance => _strings;
}
}
}
}

0 comments on commit c54794d

Please sign in to comment.