Skip to content

Commit 73cd216

Browse files
committed
TextFile partial class changed to interface ITextFile
1 parent 0389107 commit 73cd216

File tree

2 files changed

+16
-26
lines changed

2 files changed

+16
-26
lines changed

UnitTests/Mono.Debugging.Tests/Shared/DebugTests.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public abstract partial class DebugTests
4646
readonly ManualResetEvent targetStoppedEvent = new ManualResetEvent (false);
4747
readonly string EngineId;
4848
string TestName = "";
49-
TextFile SourceFile;
49+
ITextFile SourceFile;
5050

5151
SourceLocation lastStoppedPosition;
5252

@@ -102,6 +102,13 @@ public virtual void IgnoreSoftDebugger (string message = "")
102102
/// <param name="engineId">the ID of debugger engine</param>
103103
//protected DebuggerStartInfo CreateStartInfo (string test, string engineId);
104104

105+
/// <summary>
106+
/// Reads file from given path
107+
/// </summary>
108+
/// <param name="sourcePath"></param>
109+
/// <returns></returns>
110+
//protected ITextFile ReadFile (string sourcePath)
111+
105112
#endregion
106113

107114

@@ -156,7 +163,7 @@ protected virtual void Start (string test)
156163

157164

158165
var sourcePath = Path.Combine (TargetProjectSourceDir, test + ".cs");
159-
SourceFile = TextFile.ReadFile (sourcePath);
166+
SourceFile = ReadFile(sourcePath);
160167
AddBreakpoint ("break");
161168

162169
var done = new ManualResetEvent (false);

UnitTests/Mono.Debugging.Tests/Shared/TextFile.cs renamed to UnitTests/Mono.Debugging.Tests/Shared/ITextFile.cs

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,65 +25,48 @@
2525
#pragma warning disable 1587
2626
namespace Mono.Debugging.Tests
2727
{
28-
public partial class TextFile
28+
public interface ITextFile
2929
{
3030
// TODO: Implement in another part of the class
3131

32-
/// <summary>
33-
/// Reads file from given path
34-
/// </summary>
35-
/// <param name="sourcePath"></param>
36-
/// <returns></returns>
37-
// public static TextFile ReadFile (string sourcePath)
38-
// {
39-
// }
40-
4132
/// <summary>
4233
/// Content of the file
4334
/// </summary>
44-
// public string Text { get; }
35+
string Text { get; }
4536
/// <summary>
4637
/// Full path to file
4738
/// </summary>
48-
// public string Name { get; }
39+
string Name { get; }
4940

5041
/// <summary>
5142
/// Returns line and column (1-based) by given offset (0-based)
5243
/// </summary>
5344
/// <param name="offset">0-based</param>
5445
/// <param name="line">1-based</param>
5546
/// <param name="col">1-based</param>
56-
// public void GetLineColumnFromPosition (int offset, out int line, out int col)
57-
// {
58-
// }
47+
void GetLineColumnFromPosition (int offset, out int line, out int col);
5948

6049
/// <summary>
6150
/// Returns offset by given line and column (1-based)
6251
/// </summary>
6352
/// <param name="line">line (1-based)</param>
6453
/// <param name="column">column (1-based)</param>
6554
/// <returns>offset (0-based)</returns>
66-
// public int GetPositionFromLineColumn (int line, int column)
67-
// {
68-
// }
55+
int GetPositionFromLineColumn (int line, int column);
6956

7057
/// <summary>
7158
/// Returns the text starting from <paramref name="startOffset"/> with length=<paramref name="endOffset"/>
7259
/// </summary>
7360
/// <param name="startOffset">0-based starting offset</param>
7461
/// <param name="endOffset">0-based end offset</param>
7562
/// <returns></returns>
76-
// public string GetText(int startOffset, int endOffset)
77-
// {
78-
// }
63+
string GetText(int startOffset, int endOffset);
7964

8065
/// <summary>
8166
/// Returns length of the given line (1-based)
8267
/// </summary>
8368
/// <param name="line">1-based line</param>
8469
/// <returns></returns>
85-
// public int GetLineLength (int line)
86-
// {
87-
// }
70+
int GetLineLength (int line);
8871
}
8972
}

0 commit comments

Comments
 (0)