From 1df0d348415c28632cfeececa133b44e8ccafa6a Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:57:55 +0200 Subject: [PATCH] Add more unit test --- ...eFowTests.cs => CodeFowStatementsTests.cs} | 6 --- .../ProcessingStatementsTests.cs | 43 +++++++++++++++++++ 2 files changed, 43 insertions(+), 6 deletions(-) rename YesNt.Interpreter.Tests/{CodeFowTests.cs => CodeFowStatementsTests.cs} (84%) create mode 100644 YesNt.Interpreter.Tests/ProcessingStatementsTests.cs diff --git a/YesNt.Interpreter.Tests/CodeFowTests.cs b/YesNt.Interpreter.Tests/CodeFowStatementsTests.cs similarity index 84% rename from YesNt.Interpreter.Tests/CodeFowTests.cs rename to YesNt.Interpreter.Tests/CodeFowStatementsTests.cs index 66444e5..8944543 100644 --- a/YesNt.Interpreter.Tests/CodeFowTests.cs +++ b/YesNt.Interpreter.Tests/CodeFowStatementsTests.cs @@ -34,10 +34,4 @@ public class CodeFlowTests ]; YesNtAssert.IsLastLineEqual(lines, "1"); } - - [TestMethod] - public void CalculationsTest() - { - YesNtAssert.IsLineEqual("10 * 10 !calc", 100.ToString()); - } } \ No newline at end of file diff --git a/YesNt.Interpreter.Tests/ProcessingStatementsTests.cs b/YesNt.Interpreter.Tests/ProcessingStatementsTests.cs new file mode 100644 index 0000000..e445b55 --- /dev/null +++ b/YesNt.Interpreter.Tests/ProcessingStatementsTests.cs @@ -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"); + } +} \ No newline at end of file