using System; using System.IO; using System.Collections.Generic; using System.Threading.Tasks; using NUnit.Framework; using System.Linq; using System.Text; using SmartBear.TestLeft; using System.Reflection; namespace TestLeftProject1 { public class TestFixtureBase { static private IDriver _driver; static private RestSharp.DataFormat _toPreloadRestSharp = RestSharp.DataFormat.Json; static TestFixtureBase() { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; //Create a local Driver object _driver = new LocalDriver(); //Use line below instead of the above to create a remote Driver //_driver = new RemoteDriver("myhost", "userName", "password"); //Uncomment the line below to perform additional checks during code execution //_driver.Options.Debug.RuntimeChecks = SmartBear.TestLeft.Options.RuntimeChecks.All; } private static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var name = new AssemblyName(args.Name); if (name.Name == "RestSharp") { return _toPreloadRestSharp.GetType().Assembly; } return null; } protected static IDriver Driver { get { return _driver; } } [SetUp] public void TestSetUp() { _driver.Log.OpenFolder(TestContext.CurrentContext.Test.Name); } } }