tangled
alpha
login
or
join now
benharri.org
/
ircsharp
1
fork
atom
IRC parsing, tokenization, and state handling in C#
1
fork
atom
overview
issues
pulls
pipelines
keep adding more tests
benharri.org
5 years ago
7c482d8c
aabf6638
+244
-2
3 changed files
expand all
collapse all
unified
split
IrcStates
Tests
Mode.cs
Sasl.cs
User.cs
+96
-1
IrcStates/Tests/Mode.cs
···
1
1
-
using Microsoft.VisualStudio.TestTools.UnitTesting;
1
1
+
using System.Collections.Generic;
2
2
+
using IrcTokens;
3
3
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2
4
3
5
namespace IrcStates.Tests
4
6
{
5
7
[TestClass]
6
8
public class Mode
7
9
{
10
10
+
private Server _server;
11
11
+
12
12
+
[TestInitialize]
13
13
+
public void TestInitialize()
14
14
+
{
15
15
+
_server = new Server("test");
16
16
+
_server.ParseTokens(new Line("001 nickname"));
17
17
+
}
18
18
+
19
19
+
[TestMethod]
20
20
+
public void UModeAdd()
21
21
+
{
22
22
+
_server.ParseTokens(new Line("MODE nickname +i"));
23
23
+
CollectionAssert.AreEqual(new List<string> {"i"}, _server.Modes);
24
24
+
}
25
25
+
26
26
+
[TestMethod]
27
27
+
public void UModeRemove()
28
28
+
{
29
29
+
_server.ParseTokens(new Line("MODE nickname +i"));
30
30
+
_server.ParseTokens(new Line("MODE nickname -i"));
31
31
+
CollectionAssert.AreEqual(new List<string>(), _server.Modes);
32
32
+
}
33
33
+
34
34
+
[TestMethod]
35
35
+
public void PrefixAdd()
36
36
+
{
37
37
+
}
38
38
+
39
39
+
[TestMethod]
40
40
+
public void PrefixRemove()
41
41
+
{
42
42
+
}
43
43
+
44
44
+
[TestMethod]
45
45
+
public void ChannelListAdd()
46
46
+
{
47
47
+
}
48
48
+
49
49
+
[TestMethod]
50
50
+
public void ChannelListRemove()
51
51
+
{
52
52
+
}
53
53
+
54
54
+
[TestMethod]
55
55
+
public void ChannelTypeBAdd()
56
56
+
{
57
57
+
}
58
58
+
59
59
+
[TestMethod]
60
60
+
public void ChannelTypeBRemove()
61
61
+
{
62
62
+
}
63
63
+
64
64
+
[TestMethod]
65
65
+
public void ChannelTypeCAdd()
66
66
+
{
67
67
+
}
68
68
+
69
69
+
[TestMethod]
70
70
+
public void ChannelTypeCRemove()
71
71
+
{
72
72
+
}
73
73
+
74
74
+
[TestMethod]
75
75
+
public void ChannelTypeDAdd()
76
76
+
{
77
77
+
}
78
78
+
79
79
+
[TestMethod]
80
80
+
public void ChannelTypeDRemove()
81
81
+
{
82
82
+
}
83
83
+
84
84
+
[TestMethod]
85
85
+
public void ChannelNumeric()
86
86
+
{
87
87
+
}
88
88
+
89
89
+
[TestMethod]
90
90
+
public void ChannelNumericWithoutPlus()
91
91
+
{
92
92
+
}
93
93
+
94
94
+
[TestMethod]
95
95
+
public void UserNumeric()
96
96
+
{
97
97
+
}
98
98
+
99
99
+
[TestMethod]
100
100
+
public void UserNumericWithoutPlus()
101
101
+
{
102
102
+
}
8
103
}
9
104
}
+38
IrcStates/Tests/Sasl.cs
···
1
1
+
using IrcTokens;
2
2
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
3
3
+
4
4
+
namespace IrcStates.Tests
5
5
+
{
6
6
+
[TestClass]
7
7
+
public class Sasl
8
8
+
{
9
9
+
private Server _server;
10
10
+
11
11
+
[TestInitialize]
12
12
+
public void TestInitialize()
13
13
+
{
14
14
+
_server = new Server("test");
15
15
+
_server.ParseTokens(new Line("900 * nick!user@host account"));
16
16
+
}
17
17
+
18
18
+
[TestMethod]
19
19
+
public void LoggedIn()
20
20
+
{
21
21
+
Assert.AreEqual("nick", _server.NickName);
22
22
+
Assert.AreEqual("user", _server.UserName);
23
23
+
Assert.AreEqual("host", _server.HostName);
24
24
+
Assert.AreEqual("account", _server.Account);
25
25
+
}
26
26
+
27
27
+
[TestMethod]
28
28
+
public void LoggedOut()
29
29
+
{
30
30
+
_server.ParseTokens(new Line("901 * nick1!user1@host1"));
31
31
+
32
32
+
Assert.AreEqual("nick1", _server.NickName);
33
33
+
Assert.AreEqual("user1", _server.UserName);
34
34
+
Assert.AreEqual("host1", _server.HostName);
35
35
+
Assert.IsTrue(string.IsNullOrEmpty(_server.Account));
36
36
+
}
37
37
+
}
38
38
+
}
+110
-1
IrcStates/Tests/User.cs
···
1
1
-
using Microsoft.VisualStudio.TestTools.UnitTesting;
1
1
+
using IrcTokens;
2
2
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2
3
3
4
namespace IrcStates.Tests
4
5
{
5
6
[TestClass]
6
7
public class User
7
8
{
9
9
+
private Server _server;
10
10
+
11
11
+
[TestInitialize]
12
12
+
public void TestInitialize()
13
13
+
{
14
14
+
_server = new Server("test");
15
15
+
_server.ParseTokens(new Line("001 nickname"));
16
16
+
}
17
17
+
18
18
+
[TestMethod]
19
19
+
public void NicknameChange()
20
20
+
{
21
21
+
}
22
22
+
23
23
+
[TestMethod]
24
24
+
public void HostmaskJoinBoth()
25
25
+
{
26
26
+
}
27
27
+
28
28
+
[TestMethod]
29
29
+
public void HostmaskJoinUser()
30
30
+
{
31
31
+
}
32
32
+
33
33
+
[TestMethod]
34
34
+
public void HostmaskJoinHost()
35
35
+
{
36
36
+
}
37
37
+
38
38
+
[TestMethod]
39
39
+
public void ExtendedJoinWithoutExtendedJoin()
40
40
+
{
41
41
+
}
42
42
+
43
43
+
[TestMethod]
44
44
+
public void ExtendedJoinWithAccount()
45
45
+
{
46
46
+
}
47
47
+
48
48
+
[TestMethod]
49
49
+
public void ExtendedJoinWithoutAccount()
50
50
+
{
51
51
+
}
52
52
+
53
53
+
[TestMethod]
54
54
+
public void AccountNotifyWithAccount()
55
55
+
{
56
56
+
}
57
57
+
58
58
+
[TestMethod]
59
59
+
public void AccountNotifyWithoutAccount()
60
60
+
{
61
61
+
}
62
62
+
63
63
+
[TestMethod]
64
64
+
public void HostmaskPrivmsgBoth()
65
65
+
{
66
66
+
}
67
67
+
68
68
+
[TestMethod]
69
69
+
public void HostmaskPrivmsgUser()
70
70
+
{
71
71
+
}
72
72
+
73
73
+
[TestMethod]
74
74
+
public void HostmaskPrivmsgHost()
75
75
+
{
76
76
+
}
77
77
+
78
78
+
[TestMethod]
79
79
+
public void VisibleHostWithoutUsername()
80
80
+
{
81
81
+
}
82
82
+
83
83
+
[TestMethod]
84
84
+
public void VisibleHostWithUsername()
85
85
+
{
86
86
+
}
87
87
+
88
88
+
[TestMethod]
89
89
+
public void Who()
90
90
+
{
91
91
+
}
92
92
+
93
93
+
[TestMethod]
94
94
+
public void Chghost()
95
95
+
{
96
96
+
}
97
97
+
98
98
+
[TestMethod]
99
99
+
public void Whois()
100
100
+
{
101
101
+
}
102
102
+
103
103
+
[TestMethod]
104
104
+
public void AwaySet()
105
105
+
{
106
106
+
}
107
107
+
108
108
+
[TestMethod]
109
109
+
public void AwayUnset()
110
110
+
{
111
111
+
}
112
112
+
113
113
+
[TestMethod]
114
114
+
public void Setname()
115
115
+
{
116
116
+
}
8
117
}
9
118
}