public static void Create() { if (Instance != null) { throw new InvalidOperationException("TestSuiteContext can be created only once."); } Instance = new TestSuiteContext(Guid.NewGuid().ToString()); }
public TestContext(MethodInfo methodInfo, IEnumerable <object> parameters, IEnumerable <string> tags, TestSuiteContext testSuiteContext) { MethodInfo = methodInfo; Parameters = parameters; Name = methodInfo.Name; TestSuiteContext = testSuiteContext; ExecutionId = Guid.NewGuid().ToString(); CreatedOnUtc = DateTime.UtcNow; Tags = tags; testSuiteContext.TestContexts.Add(this); }
public static TestContext CurrentTestContext(this TestSuiteContext tsc) { return(tsc.TestContexts.LastOrDefault()); }