public TestResult( TestResultState state, string assembly, MethodInfo test, object[] fixtureParameters, object[] testParameters, int testFixtureRepeatIndex, int testRepeatIndex, string errorMessage, string stackTrace, TimeSpan timeTaken, string version, IEnumerable<string> authors) { State = state; Assembly = assembly; TestRepeatIndex = testRepeatIndex; TestFixtureRepeatIndex = testFixtureRepeatIndex; NameSpace = test.DeclaringType.FullName; TestName = test.Name; FullName = GetName(GetParameters(fixtureParameters), GetParameters(testParameters)); ErrorMessage = errorMessage; StackTrace = stackTrace; TimeTaken = timeTaken; Version = version; Authors = authors; CreateDateTime = DateTime.Now; }
private void AddResult(TestResultState state, [CanBeNull] Uri link, [NotNull] ShortMessage message, [CanBeNull] DetailedMessage detailed, [CanBeNull] string instanceName) { Assert.ArgumentNotNull(message, nameof(message)); Log.Info($"Test output: {state}, {message}{(link != null ? ", " + link.AbsoluteUri : null)}"); Results.Add(new TestOutput(state, message, link, detailed, instanceName)); }
private static TestFileRunResult GenerateStubTestFileResult(TestResultState resultState = TestResultState.Success, bool taskFails = false) { var runResult = new TestFileRunResult { ResultId = taskFails ? (Guid?)null : Guid.NewGuid(), Finished = !taskFails, HasFailedTests = resultState == TestResultState.Failed, ErrorMessage = string.Empty, TestRunFailed = taskFails, TimeTaken = TimeSpan.FromDays(1), TestResults = taskFails ? new LightweightResult[0] : new[] { new LightweightResult { ResultState = resultState, ActualUrl = "some-url", AssertionsSuccess = true, ExceptionMessage = "ExceptionMessage", Message = "some=message", ResponseCodeSuccess = true, ResponseTime = TimeSpan.FromMinutes(4), ScriptCompilationSuccess = true, TestDescription = "supa-init-test-blah-blink-bloom", TestUrl = "♪ ♫ ♬ 'I can't dream anymore, since you leeeeeft' ♪ ♫ ♬" } } }; return(runResult); }
/// <summary> /// Initializes a new instance of the <see cref="EventCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualEvents">The actual events.</param> /// <param name="actualException">The actual exception.</param> internal EventCentricTestResult(EventCentricTestSpecification specification, TestResultState state, Optional<Fact[]> actualEvents, Optional<Exception> actualException) { _specification = specification; _state = state; _actualEvents = actualEvents; _actualException = actualException; }
/// <summary> /// Initializes a new instance of the <see cref="EventCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualEvents">The actual events.</param> /// <param name="actualException">The actual exception.</param> internal EventCentricTestResult(EventCentricTestSpecification specification, TestResultState state, Optional <Fact[]> actualEvents, Optional <Exception> actualException) { _specification = specification; _state = state; _actualEvents = actualEvents; _actualException = actualException; }
/// <summary> /// Initializes a new instance of the <see cref="ResultCentricAggregateQueryTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualResult">The actual result.</param> /// <param name="actualException">The actual exception.</param> /// <param name="actualEvents">The actual events.</param> internal ResultCentricAggregateQueryTestResult(ResultCentricAggregateQueryTestSpecification specification, TestResultState state, Optional<object> actualResult, Optional<Exception> actualException, Optional<object[]> actualEvents) { _specification = specification; _state = state; _actualResult = actualResult; _actualException = actualException; _actualEvents = actualEvents; }
/// <summary> /// Initializes a new instance of the <see cref="ResultCentricAggregateQueryTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualResult">The actual result.</param> /// <param name="actualException">The actual exception.</param> /// <param name="actualEvents">The actual events.</param> internal ResultCentricAggregateQueryTestResult(ResultCentricAggregateQueryTestSpecification specification, TestResultState state, Optional <object> actualResult, Optional <Exception> actualException, Optional <object[]> actualEvents) { _specification = specification; _state = state; _actualResult = actualResult; _actualException = actualException; _actualEvents = actualEvents; }
private bool PrintFoldout(string fullName, string displayName, TestResultState resultState) { if (hiddenGroups.Contains(fullName)) { if (showHidden) { displayName += " (hidden)"; } else { return(true); } } EditorGUIUtility.SetIconSize(new Vector2(16, 16)); GUILayout.BeginHorizontal(GUILayout.Height(18)); Indent(); var foldoutGUIContent = new GUIContent(displayName, GuiHelper.GetIconForCategoryResult(resultState), fullName); var style = IsGroupSelected(fullName) ? Styles.selectedFoldout : Styles.foldout; var rect = GUILayoutUtility.GetRect(foldoutGUIContent, style, GUILayout.MaxHeight(16)); if (rect.Contains(Event.current.mousePosition)) { if (Event.current.type == EventType.ContextClick) { PrintFoldoutContextMenu(fullName); } if (Event.current.type == EventType.mouseDown && Event.current.button == 0 && Event.current.control) { SelectGroup(fullName); Event.current.Use(); } } bool isClassFolded = foldMarkers.Contains(fullName); EditorGUI.BeginChangeCheck(); isClassFolded = !EditorGUI.Foldout(rect, !isClassFolded, foldoutGUIContent, true, style); if (EditorGUI.EndChangeCheck()) { if (isClassFolded) { foldMarkers.Add(fullName); } else { foldMarkers.RemoveAll(s => s == fullName); } } GUILayout.EndHorizontal(); EditorGUIUtility.SetIconSize(Vector2.zero); return(isClassFolded); }
public TestResult(string testName, int successfulAssertions, string failure, IEnumerable <string> messages) { state = TestResultState.Failure; this.testName = testName; this.successfulAssertions = successfulAssertions; this.failure = failure; exception = null; this.messages = messages; }
public TestOutput(TestResultState state, [NotNull] ShortMessage message, Uri link = null, DetailedMessage data = null, string instanceName = null) { Assert.ArgumentNotNull(message, nameof(message)); State = state; Message = message; Link = link; Detailed = data; Instance = instanceName; }
public TestResult(string testName, int successfulAssertions, Exception exceptions, IEnumerable <string> messages) { state = TestResultState.Error; this.testName = testName; this.successfulAssertions = successfulAssertions; failure = null; exception = exceptions; this.messages = messages; }
/// <summary> /// Initializes a new instance of the <see cref="EventCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualEvents">The actual events.</param> /// <param name="actualException">The actual exception.</param> internal EventCentricAggregateConstructorTestResult( EventCentricAggregateConstructorTestSpecification specification, TestResultState state, Optional <object[]> actualEvents, Optional <Exception> actualException) { _specification = specification; _state = state; _actualEvents = actualEvents; _actualException = actualException; }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualException">The actual exception.</param> /// <param name="actualEvents">The actual events.</param> internal ExceptionCentricAggregateFactoryTestResult( ExceptionCentricAggregateFactoryTestSpecification specification, TestResultState state, Optional <Exception> actualException, Optional <object[]> actualEvents) { Specification = specification; _state = state; ButException = actualException; ButEvents = actualEvents; }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualException">The actual exception.</param> /// <param name="actualEvents">The actual events.</param> internal ExceptionCentricAggregateConstructorTestResult( ExceptionCentricAggregateConstructorTestSpecification specification, TestResultState state, Optional<Exception> actualException, Optional<object[]> actualEvents) { _specification = specification; _state = state; _actualException = actualException; _actualEvents = actualEvents; }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualException">The actual exception.</param> /// <param name="actualEvents">The actual events.</param> internal ExceptionCentricAggregateCommandTestResult( ExceptionCentricAggregateCommandTestSpecification specification, TestResultState state, Optional <Exception> actualException, Optional <object[]> actualEvents) { _specification = specification; _state = state; _actualException = actualException; _actualEvents = actualEvents; }
/// <summary> /// Initializes a new instance of the <see cref="EventCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualEvents">The actual events.</param> /// <param name="actualException">The actual exception.</param> internal EventCentricAggregateCommandTestResult( EventCentricAggregateCommandTestSpecification specification, TestResultState state, Optional<object[]> actualEvents, Optional<Exception> actualException) { _specification = specification; _state = state; _actualEvents = actualEvents; _actualException = actualException; }
public void InvalidateGroup(TestResultState? newResult) { if (!this.m_ResultState.HasValue || ((this.m_ResultState.Value != newResult.GetValueOrDefault()) || !newResult.HasValue)) { this.m_RefreshResults = true; if (base.m_ParentGroup != null) { base.m_ParentGroup.InvalidateGroup(newResult); } } }
/// <summary> /// Initializes a new instance of the <see cref="EventCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualEvents">The actual events.</param> /// <param name="actualException">The actual exception.</param> internal EventCentricAggregateCommandTestResult( EventCentricAggregateCommandTestSpecification specification, TestResultState state, Optional <object[]> actualEvents, Optional <Exception> actualException) { Specification = specification; _state = state; ButEvents = actualEvents; ButException = actualException; }
/// <summary> /// Initializes a new instance of the <see cref="EventCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualEvents">The actual events.</param> /// <param name="actualException">The actual exception.</param> internal EventCentricTestResult(EventCentricTestSpecification specification, TestResultState state, Tuple<string, object>[] actualEvents = null, Exception actualException = null) { _specification = specification; _state = state; _actualEvents = actualEvents == null ? Optional<Tuple<string, object>[]>.Empty : new Optional<Tuple<string, object>[]>(actualEvents); _actualException = actualException == null ? Optional<Exception>.Empty : new Optional<Exception>(actualException); }
/// <summary> /// Initializes a new instance of the <see cref="EventCentricTestResult"/> class. /// </summary> /// <param name="specification">The specification.</param> /// <param name="state">The state.</param> /// <param name="actualEvents">The actual events.</param> /// <param name="actualException">The actual exception.</param> internal EventCentricTestResult(EventCentricTestSpecification specification, TestResultState state, Tuple <string, object>[] actualEvents = null, Exception actualException = null) { _specification = specification; _state = state; _actualEvents = actualEvents == null ? Optional <Tuple <string, object>[]> .Empty : new Optional <Tuple <string, object>[]>(actualEvents); _actualException = actualException == null ? Optional <Exception> .Empty : new Optional <Exception>(actualException); }
public TestResultIcon(TestResultState state) { switch(state) { case TestResultState.PASS: Data = TEST_ICON_PASS; Color = TEST_ICON_PASS_COLOR; break; default: Data = TEST_ICON_FAIL; Color = TEST_ICON_FAIL_COLOR; break; } }
public void Update(ITestResult source, bool outdated) { this.m_ResultState = source.resultState; this.m_Duration = source.duration; this.m_Message = source.message; this.m_Logs = source.logs; this.m_StackTrace = source.stackTrace; this.m_Executed = source.executed; this.m_IsIgnored = source.isIgnored || ((this.test != null) && this.test.isIgnored); this.m_Outdated = outdated; if (base.m_ParentGroup != null) { base.m_ParentGroup.InvalidateGroup(new TestResultState?(this.m_ResultState)); } if (base.m_OnResultUpdate != null) { base.m_OnResultUpdate(this); } }
public static Texture GetIconForTestResult (TestResultState resultState) { switch (resultState) { case TestResultState.Failure: case TestResultState.Error: return Icons.failImg; case TestResultState.Success: return Icons.successImg; case TestResultState.Ignored: case TestResultState.Skipped: return Icons.ignoreImg; case TestResultState.Inconclusive: return Icons.inconclusiveImg; case TestResultState.Cancelled: default: return Icons.unknownImg; } }
public static Texture GetIconForResult(TestResultState resultState) { switch (resultState) { case TestResultState.Success: return Icons.SuccessImg; case TestResultState.Failure: case TestResultState.Error: return Icons.FailImg; case TestResultState.Ignored: case TestResultState.Skipped: return Icons.IgnoreImg; case TestResultState.Inconclusive: case TestResultState.Cancelled: case TestResultState.NotRunnable: return Icons.InconclusiveImg; default: return Icons.UnknownImg; } }
public static Texture GetIconForTestResult(TestResultState resultState) { switch (resultState) { case TestResultState.Failure: case TestResultState.Error: return(Icons.failImg); case TestResultState.Success: return(Icons.successImg); case TestResultState.Ignored: case TestResultState.Skipped: return(Icons.ignoreImg); case TestResultState.Inconclusive: return(Icons.inconclusiveImg); case TestResultState.Cancelled: default: return(Icons.unknownImg); } }
public static Texture GetIconForCategoryResult(TestResultState resultState) { switch (resultState) { case TestResultState.Failure: case TestResultState.Error: return(Icons.failImg); case TestResultState.Success: return(Icons.successImg); case TestResultState.Cancelled: case TestResultState.Inconclusive: case TestResultState.NotRunnable: case TestResultState.Skipped: return(Icons.unknownImg); case TestResultState.Ignored: return(Icons.unknownImg); default: return(null); } }
public void Transfer(ref TestResultState val) { _stream.WriteByte((byte)val); }
public void Transfer(ref TestResultState val) { val = (TestResultState)((byte)this._stream.ReadByte()); }
public AssertException(string message, Exception inner, TestResultState state = TestResultState.Failure) : base(message, inner, state) { }
private bool PrintFoldout (string fullName, string displayName, TestResultState resultState) { if(hiddenGroups.Contains (fullName)) { if (showHidden) displayName += " (hidden)"; else return true; } EditorGUIUtility.SetIconSize(new Vector2(12,12)); GUILayout.BeginHorizontal (GUILayout.Height (18)); Indent (); var foldoutGUIContent = new GUIContent(displayName, GuiHelper.GetIconForCategoryResult(resultState), fullName); var style = IsGroupSelected (fullName) ? Styles.selectedFoldout : Styles.foldout; var rect = GUILayoutUtility.GetRect (foldoutGUIContent, style, GUILayout.MaxHeight (18)); if (rect.Contains (Event.current.mousePosition)) { if (Event.current.type == EventType.ContextClick) { PrintFoldoutContextMenu (fullName); } if (Event.current.type == EventType.mouseDown && Event.current.button == 0 && Event.current.control) { SelectGroup (fullName); Event.current.Use (); } } bool isClassFolded = foldMarkers.Contains (fullName); EditorGUI.BeginChangeCheck (); isClassFolded = !EditorGUI.Foldout (rect, !isClassFolded, foldoutGUIContent, true, style); if (EditorGUI.EndChangeCheck ()) { if (isClassFolded) foldMarkers.Add (fullName); else foldMarkers.RemoveAll (s => s == fullName); } GUILayout.EndHorizontal (); EditorGUIUtility.SetIconSize(Vector2.zero); return isClassFolded; }
public void Transfer(ref TestResultState val) { val = (TestResultState)_stream.ReadByte(); }
public TestResultStateException(string message, TestResultState state) : base(message) { TestResultState = state; }
public TestResultStateException(string message, Exception inner, TestResultState state) : base(message, inner) { TestResultState = state; }
private TestResult PopulateTestResult(MethodInfo testMethod, TestResult result, TestResultState state, TimeSpan time, string errorMessage = "", string stackTrace = "") { result.State = state; result.ErrorMessage = errorMessage; result.StackTrace = stackTrace; result.TimeTaken = time; if (testMethod != default(MethodInfo)) { result.Authors = ReflectionRepository.GetAuthors(testMethod); result.Version = ReflectionRepository.GetVersion(testMethod); } return result; }