diff options
author | Kyle White <kyle.white@xamarin.com> | 2016-01-20 20:53:57 +0300 |
---|---|---|
committer | Kyle White <kyle.white@xamarin.com> | 2016-01-20 20:53:57 +0300 |
commit | a5901e31a8a5c91da3f723f8c9bca1484c8c4e0c (patch) | |
tree | 0040496d3e51ef526e44cfb4b5b5bba791f4952c /main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest | |
parent | 073348b825cf9e93bd10ee60a7b39370d43e282e (diff) |
[AutoTest] Added a method for getting TaskService errors
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest')
3 files changed, 76 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs index 81878d1ab2..e3251563aa 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs @@ -213,6 +213,11 @@ namespace MonoDevelop.Components.AutoTest return session.ErrorCount (severity); } + public List<TaskListEntryDTO> GetErrors (TaskSeverity severity) + { + return session.GetErrors (severity); + } + public void WaitForEvent (string name) { WaitForEvent (name, defaultEventWaitTimeout); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs index 805b29718d..66072db1b4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs @@ -242,6 +242,17 @@ namespace MonoDevelop.Components.AutoTest return TaskService.Errors.Count (x => x.Severity == severity); } + public List<TaskListEntryDTO> GetErrors (TaskSeverity severity) + { + return TaskService.Errors.Where (x => x.Severity == severity).Select (x => new TaskListEntryDTO () { + Line = x.Line, + Description = x.Description, + File = x.FileName.FileName, + Path = x.FileName.FullPath, + Project = x.WorkspaceObject.Name + }).ToList (); + } + object SafeObject (object ob) { if (ob == null) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/DataTransferObjects.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/DataTransferObjects.cs new file mode 100644 index 0000000000..acd6e94e2e --- /dev/null +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/DataTransferObjects.cs @@ -0,0 +1,60 @@ +// +// DataTransferObjects.cs +// +// Author: +// kylewhite <kyle.white@xamarin.com> +// +// Copyright (c) 2016 kylewhite +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using MonoDevelop.Core; + +namespace MonoDevelop.Components.AutoTest +{ + [Serializable] + public class TaskListEntryDTO + { + public string Description { + get; + set; + } + + public string File { + get; + set; + } + + public string Path { + get; + set; + } + + public int Line { + get; + set; + } + + public string Project { + get; + set; + } + } +} + |