-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimulator.cs
More file actions
52 lines (40 loc) · 811 Bytes
/
Copy pathSimulator.cs
File metadata and controls
52 lines (40 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
namespace BddWithXamarinUITest
{
public class Simulator
{
public Simulator(string line)
{
ParseLine(line);
}
public string Line { get; private set; }
public string GUID { get; private set; }
public string Name { get; private set; }
public bool IsValid()
{
return !string.IsNullOrWhiteSpace(GUID) && !(string.IsNullOrWhiteSpace(Name));
}
public override string ToString()
{
return Line;
}
void ParseLine(string line)
{
GUID = string.Empty;
Name = string.Empty;
Line = string.Empty;
if (string.IsNullOrWhiteSpace(line))
{
return;
}
Line = line.Trim();
var idx1 = line.IndexOf(" [");
if (idx1 < 1)
{
return;
}
Name = Line.Substring(0, idx1).Trim();
GUID = Line.Substring(idx1 + 2, 36).Trim();
}
}
}