Add more unit test

This commit is contained in:
Stone_Red
2024-08-08 23:57:55 +02:00
parent 9a6f1d7806
commit 1df0d34841
2 changed files with 43 additions and 6 deletions
@@ -34,10 +34,4 @@ public class CodeFlowTests
]; ];
YesNtAssert.IsLastLineEqual(lines, "1"); YesNtAssert.IsLastLineEqual(lines, "1");
} }
[TestMethod]
public void CalculationsTest()
{
YesNtAssert.IsLineEqual("10 * 10 !calc", 100.ToString());
}
} }
@@ -0,0 +1,43 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace YesNt.Interpreter.Tests;
[TestClass]
public class ProcessingStatementsTests
{
[TestMethod]
public void MultiplicationTest()
{
YesNtAssert.IsLineEqual("10 * 10 !calc", "100");
}
[TestMethod]
public void DivisionTest()
{
YesNtAssert.IsLineEqual("90 / 4 !calc", "22.5");
}
[TestMethod]
public void AdditionTest()
{
YesNtAssert.IsLineEqual("10 + 10 !calc", "20");
}
[TestMethod]
public void SubtractionTest()
{
YesNtAssert.IsLineEqual("10 - 10 !calc", "0");
}
[TestMethod]
public void ModulusTest()
{
YesNtAssert.IsLineEqual("10 % 3 !calc", "1");
}
[TestMethod]
public void ExponentiationTest()
{
YesNtAssert.IsLineEqual("2 ^ 3 !calc", "8");
}
}