protected override string Serialize(_ITestCase testCase) { try { return(base.Serialize(testCase)); } catch (SerializationException) { // Mocks can't be serialized, so fall back if anything in the chain isn't serializable return($"Serialization of test case '{testCase.DisplayName}'"); } }
/// <inheritdoc/> protected override string Serialize(_ITestCase testCase) { Guard.ArgumentNotNull(nameof(testCase), testCase); if (testCase.GetType() == XunitTestCaseType) { var xunitTestCase = (XunitTestCase)testCase; var className = testCase.TestMethod.TestClass.Class.Name.Replace(":", "::"); var methodName = testCase.TestMethod.Method.Name.Replace(":", "::"); var timeout = xunitTestCase.Timeout; var methodDisplay = (int)xunitTestCase.DefaultMethodDisplay; var methodDisplayOptions = (int)xunitTestCase.DefaultMethodDisplayOptions; var skipReason = testCase.SkipReason == null ? "(null)" : Convert.ToBase64String(Encoding.UTF8.GetBytes(testCase.SkipReason)); return($":F:{className}:{methodName}:{methodDisplay}:{methodDisplayOptions}:{timeout}:{skipReason}"); } return(base.Serialize(testCase)); }
public bool ReportDiscoveredTestCase_Public( _ITestCase testCase, bool includeSourceInformation, IMessageBus messageBus) => ReportDiscoveredTestCase(testCase, includeSourceInformation, messageBus);