-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnitTest1.cs
37 lines (34 loc) · 1.11 KB
/
UnitTest1.cs
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
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using SignalTranslatorCore;
namespace UnitTestProject
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void DelimiterHell()
{
var inp = new StringAsFileBuffer("<= +- > <>> <=>");
var lexer = new LexAn();
lexer.Scan(inp);
CollectionAssert.AreEqual(lexer.Output, new List<int> { 12, 4, 5, 13 , 15, 13, 12, 13});
}
[TestMethod]
public void Identifiers()
{
var inp = new StringAsFileBuffer("exe > x program >= 1488;x54");
var lexer = new LexAn();
lexer.Scan(inp);
CollectionAssert.AreEqual(lexer.Output, new List<int> { 500, 13, 501, 300, 11, 400, 3, 502 });
}
[TestMethod]
public void Tree()
{
var t = new Tree<string>();
t.Root = new TreeNode<string>("Hello");
t.Root.AddNode("Bye").AddNode("lol").AddNode("gee");
Assert.AreEqual("Hello [ Bye [ lol [ gee ] ] ]", t.ToString());
}
}
}