• GetLoweredFirstLetter
Return the first letter of the given word, in lower case.
Input example: " Hello "
Output Example: "h"
• CalculateStudentPoints
Write a program that calculates the total points of a student, based on how many answers he got right/wrong.
For each right answer (O) the student gets 1 point.
For each wrong answer (X) the studend loses 1 point.
If the student did not answer any question, he should lose 1 point.
If the student surpases 5 total points, he should receive 1 aditional point
If the student has lost 5 or more total points, he should be "eliminated"
Input Example: ["O", "O", "X"]
Output example: "1 point"
public class Basic
{
public static string GetLoweredFirstLetter(string text)
{
return null;
}
public static string CalculateStudentPoints(string[] answers)
{
return null;
}
}
namespace Solution
{
using NUnit.Framework;
using System;
[TestFixture]
public class SolutionTest
{
[Test]
public void TestGetLoweredFirstLetter()
{
Assert.AreEqual("h", Basic.GetLoweredFirstLetter("hello"));
Assert.AreEqual("h", Basic.GetLoweredFirstLetter("Hello"));
Assert.AreEqual("w", Basic.GetLoweredFirstLetter("World"));
Assert.AreEqual("w", Basic.GetLoweredFirstLetter("world"));
Assert.AreEqual("a", Basic.GetLoweredFirstLetter("apple"));
Assert.AreEqual("a", Basic.GetLoweredFirstLetter("Apple"));
Assert.AreEqual("h", Basic.GetLoweredFirstLetter(" hello"));
Assert.AreEqual("h", Basic.GetLoweredFirstLetter(" Hello"));
Assert.AreEqual("w", Basic.GetLoweredFirstLetter(" World"));
Assert.AreEqual("w", Basic.GetLoweredFirstLetter( "world"));
Assert.AreEqual("a", Basic.GetLoweredFirstLetter(" apple"));
Assert.AreEqual("a", Basic.GetLoweredFirstLetter(" Apple"));
Assert.AreEqual("h", Basic.GetLoweredFirstLetter(" hello "));
Assert.AreEqual("h", Basic.GetLoweredFirstLetter(" Hello "));
Assert.AreEqual("w", Basic.GetLoweredFirstLetter(" World"));
Assert.AreEqual("w", Basic.GetLoweredFirstLetter("world "));
Assert.AreEqual("a", Basic.GetLoweredFirstLetter(" apple "));
Assert.AreEqual("a", Basic.GetLoweredFirstLetter(" Apple "));
}
[Test]
public void TestCalculateStudentPoints()
{
Assert.AreEqual("1 point", Basic.CalculateStudentPoints(new string[] {"O", "O", "X"}));
Assert.AreEqual("1 point", Basic.CalculateStudentPoints(new string[] {"O"}));
Assert.AreEqual("1 point", Basic.CalculateStudentPoints(new string[] {"O", "X", "O", "X", "O"}));
Assert.AreEqual("-1 point", Basic.CalculateStudentPoints(new string[] {"X"}));
Assert.AreEqual("0 points", Basic.CalculateStudentPoints(new string[] {"O", "X"}));
Assert.AreEqual("3 points", Basic.CalculateStudentPoints(new string[] {"O", "O", "X", "O", "X", "O", "O"}));
Assert.AreEqual("-1 point", Basic.CalculateStudentPoints(new string[] {"O", "X", "X"}));
Assert.AreEqual("-3 points", Basic.CalculateStudentPoints(new string[] {"X", "X", "X"}));
Assert.AreEqual("8 points", Basic.CalculateStudentPoints(new string[] {"O", "O", "O", "O", "O", "O", "O"}));
Assert.AreEqual("5 points", Basic.CalculateStudentPoints(new string[] {"O", "O", "O", "X", "O", "O", "O"}));
Assert.AreEqual("-1 point", Basic.CalculateStudentPoints(new string[] {}));
Assert.AreEqual("-1 point", Basic.CalculateStudentPoints(null));
Assert.AreEqual("9 points", Basic.CalculateStudentPoints(new string[] {"O", "O", "O", "O", "O", "O", "O", "O"}));
Assert.AreEqual("-4 points", Basic.CalculateStudentPoints(new string[] {"X", "X", "O", "X", "X", "X"}));
Assert.AreEqual("eliminated", Basic.CalculateStudentPoints(new string[] {"X", "X", "O", "X", "X", "X", "X"}));
}
}
}
• ToLowerCaseArray
You need to return a string array, lowering the case of every world.
Remove the spaces that can occur in the beginning or ending of a word.
Input example: "HELLO WORLD"
Output Example: ["hello", "world"]
All text will contain a single space as separator
• ToUpperCaseString
Upper case every word in the aray and return a string with the words separated by a single space.
Remove the spaces that can occur in the beginning or ending of a word.
Input example: ["HELLO", "WORLD"]
Output Example: "hello world"
• RemoveUnnecessarySpaces
You need to remove all unecessary spaces from the given text
Including spaces in the beginning and ending of the text
Double or more spaces between the words
Input example: " Hello world "
Output Example: "Hello world"
• GetTheFirstLetter
Return the first letter of the given word
Input example: " Hello"
Output Example: "H"
• UpperCaseFirstLetter
You should transform the given text so the first letter is upper case and the other are lower case.
Remove the spaces that can occur in the beginning or ending of a word.
Input example: "hello"
Output Example: "Hello"
• ToCamelCase
You need to remove every space and also upper case the first letter of every world
Input example: "the apple is very juice "
Output Example: "TheAppleIsVeryJuice"
Spaces can occur multiple time including in the begining and ending
public class Basic
{
public static string[] ToLowerCaseArray(string text)
{
return null;
}
public static string ToUpperCaseString(string[] words)
{
return null;
}
public static string RemoveUnnecessarySpaces(string text)
{
return null;
}
public static string GetTheFirstLetter(string text)
{
return null;
}
public static string UpperCaseFirstLetter(string text)
{
return null;
}
public static string ToCamelCase(string text)
{
return null;
}
}
namespace Solution
{
using NUnit.Framework;
using System;
[TestFixture]
public class SolutionTest
{
[Test]
public void TestToLowerCaseArray()
{
Assert.AreEqual(new string[] {"hello", "world"}, Basic.ToLowerCaseArray("HELLO WORLD"));
Assert.AreEqual(new string[] {"hello", "world"}, Basic.ToLowerCaseArray("hello World"));
Assert.AreEqual(new string[] {"hello", "world"}, Basic.ToLowerCaseArray(" hello World "));
Assert.AreEqual(new string[] {"time", "is", "money", "friend"}, Basic.ToLowerCaseArray("TIME is money frIENd"));
Assert.AreEqual(new string[] {"the", "apple", "is", "very", "juice"}, Basic.ToLowerCaseArray("the apple is very juice"));
Assert.AreEqual(new string[] {"a", "b", "1", "2", "c"}, Basic.ToLowerCaseArray(" A b 1 2 c"));
Assert.AreEqual(new string[] {"ab12c"}, Basic.ToLowerCaseArray("Ab12c"));
Assert.AreEqual(new string[] {""}, Basic.ToLowerCaseArray(" "));
}
[Test]
public void TestToUpperCaseString()
{
Assert.AreEqual("HELLO WORLD", Basic.ToUpperCaseString(new string[] {"hello", "world"}));
Assert.AreEqual("HELLO WORLD", Basic.ToUpperCaseString(new string[] {"HELLO", "WORLD"}));
Assert.AreEqual("", Basic.ToUpperCaseString(new string[] {}));
Assert.AreEqual("THE APPLE IS VERY JUICE", Basic.ToUpperCaseString(new string[] {"The", "Apple", "IS", "VERY", "juice"}));
Assert.AreEqual("A B C D E F G H I J K", Basic.ToUpperCaseString(new string[] {"A", "b", "C", "D", "E", "f", "G", "h", "i", "j", "K"}));
}
[Test]
public void TestRemoveUnnecessarySpaces()
{
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces("Hello world"));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world"));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces("Hello world "));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world"));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world "));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world "));
Assert.AreEqual("the apple is very juice", Basic.RemoveUnnecessarySpaces(" the apple is very juice "));
Assert.AreEqual("", Basic.RemoveUnnecessarySpaces(" "));
Assert.AreEqual("", Basic.RemoveUnnecessarySpaces(" "));
}
[Test]
public void TestGetTheFirstLetter()
{
Assert.AreEqual("h", Basic.GetTheFirstLetter("hello"));
Assert.AreEqual("H", Basic.GetTheFirstLetter("Hello"));
Assert.AreEqual("W", Basic.GetTheFirstLetter("World"));
Assert.AreEqual("w", Basic.GetTheFirstLetter("world"));
Assert.AreEqual("a", Basic.GetTheFirstLetter("apple"));
Assert.AreEqual("A", Basic.GetTheFirstLetter("Apple"));
Assert.AreEqual("h", Basic.GetTheFirstLetter(" hello"));
Assert.AreEqual("H", Basic.GetTheFirstLetter(" Hello"));
Assert.AreEqual("W", Basic.GetTheFirstLetter(" World"));
Assert.AreEqual("w", Basic.GetTheFirstLetter( "world"));
Assert.AreEqual("a", Basic.GetTheFirstLetter(" apple"));
Assert.AreEqual("A", Basic.GetTheFirstLetter(" Apple"));
Assert.AreEqual("h", Basic.GetTheFirstLetter(" hello "));
Assert.AreEqual("H", Basic.GetTheFirstLetter(" Hello "));
Assert.AreEqual("W", Basic.GetTheFirstLetter(" World"));
Assert.AreEqual("w", Basic.GetTheFirstLetter("world "));
Assert.AreEqual("a", Basic.GetTheFirstLetter(" apple "));
Assert.AreEqual("A", Basic.GetTheFirstLetter(" Apple "));
}
[Test]
public void TestUpperCaseFirstLetter()
{
Assert.AreEqual("Hello", Basic.UpperCaseFirstLetter("hello"));
Assert.AreEqual("Hello", Basic.UpperCaseFirstLetter("Hello"));
Assert.AreEqual("Hello", Basic.UpperCaseFirstLetter("HelLo"));
Assert.AreEqual("Hello", Basic.UpperCaseFirstLetter("HELLO"));
Assert.AreEqual("Hello", Basic.UpperCaseFirstLetter("hELLO"));
Assert.AreEqual("Hello", Basic.UpperCaseFirstLetter("hELLo"));
}
[Test]
public void TestToCamelCase()
{
Assert.AreEqual("TheAppleIsVeryJuice", Basic.ToCamelCase("the apple is very juice"));
Assert.AreEqual("TheAppleIsVeryJuice", Basic.ToCamelCase(" the apple is very juice"));
Assert.AreEqual("TheAppleIsVeryJuice", Basic.ToCamelCase(" the apple is very juice "));
Assert.AreEqual("TheAppleIsVeryJuice", Basic.ToCamelCase(" the apple is very juice "));
Assert.AreEqual("TheAppleIsVeryJuice", Basic.ToCamelCase(" the apple is very juice"));
Assert.AreEqual("TheAppleIsVeryJuice", Basic.ToCamelCase(" the apple is very juice "));
Assert.AreEqual("TheAppleIsVeryJuice", Basic.ToCamelCase(" The aPple iS VERY JuicE "));
}
}
}
• ConvertTextToLong
You will receive a text which you need to convert to a long.
Input example: "105"
Output example: 105
All input will be valid numbers
• ConvertTextToDecimal
You will receive a text which you need to convert to a decimal
Input example: "30.7"
Output example: 30.7
All input will be valid numbers
• ConvertIntToLong
You will receive long which you need to convert to an int
Input example: 57
Output example: 57
• ToUpperCaseArray
You need to return a string array, upper casing every world
Input example: "hello world"
Output Example: ["HELLO", "WORLD"]
All text will contain a single space.
Spaces can occur in the begining or ending of the string
• ToLowerCaseString
Lower case every word in the given aray and return a string with all words separated by a single space.
Remove the spaces that can occur in the beginning or ending of a word.
Input example: ["HELLO", "WORLD"]
Output Example: "hello world"
All text will contain a single space.
• IsUpperCase
Based on a given text, you should:
Return 1 if all letters are upper case.
Return 0 if at least one letter is lower case
Return -1 if the text is either null, empty or only white spaces
Input example: "HELLO"
Output Example: 1
• RemoveUnnecessarySpaces
You need to remove all unecessary spaces from the given text
Including spaces in the beginning and ending of the text
Double or more spaces between the words
Input example: " Hello world "
Output Example: "Hello world"
public class Basic
{
public static long ConvertTextToLong(string numberAsText)
{
return 0;
}
public static decimal ConvertTextToDecimal(string numberAsText)
{
return 0;
}
public static long ConvertIntToLong(int number)
{
return 0;
}
public static string[] ToUpperCaseArray(string text)
{
return null;
}
public static string ToLowerCaseString(string[] words)
{
return null;
}
public static int IsUpperCase(string text)
{
return 0;
}
public static string RemoveUnnecessarySpaces(string text)
{
return null;
}
}
namespace Solution
{
using NUnit.Framework;
using System;
[TestFixture]
public class SolutionTest
{
[Test]
public void TestConvertTextToLong()
{
Assert.AreEqual(1L, Basic.ConvertTextToLong("1"));
Assert.AreEqual(-1L, Basic.ConvertTextToLong("-1"));
Assert.AreEqual(99L, Basic.ConvertTextToLong("99"));
Assert.AreEqual(2L, Basic.ConvertTextToLong("02"));
Assert.AreEqual(7L, Basic.ConvertTextToLong("007"));
Assert.AreEqual(long.MaxValue, Basic.ConvertTextToLong("" + long.MaxValue));
}
[Test]
public void TestConvertTextToDecimal()
{
Assert.AreEqual(1m, Basic.ConvertTextToDecimal("1"));
Assert.AreEqual(-1m, Basic.ConvertTextToDecimal("-1"));
Assert.AreEqual(99m, Basic.ConvertTextToDecimal("99"));
Assert.AreEqual(2m, Basic.ConvertTextToDecimal("02"));
Assert.AreEqual(7m, Basic.ConvertTextToDecimal("007"));
Assert.AreEqual(decimal.MaxValue, Basic.ConvertTextToDecimal("" + decimal.MaxValue));
}
[Test]
public void TestConvertIntToLong()
{
Assert.AreEqual(1L, Basic.ConvertIntToLong(1));
Assert.AreEqual(-99L, Basic.ConvertIntToLong(-99));
Assert.AreEqual(0L, Basic.ConvertIntToLong(0));
Assert.AreEqual(3215487L, Basic.ConvertIntToLong(3215487));
Assert.AreEqual(-3215487L, Basic.ConvertIntToLong(-3215487));
Assert.AreEqual(int.MaxValue, Basic.ConvertIntToLong(int.MaxValue));
}
[Test]
public void TestToUpperCaseArray()
{
Assert.AreEqual(new string[] {"HELLO", "WORLD"}, Basic.ToUpperCaseArray("HELLO WORLD"));
Assert.AreEqual(new string[] {"HELLO", "WORLD"}, Basic.ToUpperCaseArray("hello World"));
Assert.AreEqual(new string[] {"HELLO", "WORLD"}, Basic.ToUpperCaseArray(" hello World "));
Assert.AreEqual(new string[] {"TIME", "IS", "MONEY", "FRIEND"}, Basic.ToUpperCaseArray("TIME is money frIENd"));
Assert.AreEqual(new string[] {"THE", "APPLE", "IS", "VERY", "JUICE"}, Basic.ToUpperCaseArray("the apple is very juice"));
Assert.AreEqual(new string[] {"A", "B", "1", "2", "C"}, Basic.ToUpperCaseArray(" A b 1 2 c"));
Assert.AreEqual(new string[] {"AB12C"}, Basic.ToUpperCaseArray("Ab12c"));
Assert.AreEqual(new string[] {""}, Basic.ToUpperCaseArray(" "));
}
[Test]
public void TestToLowerCaseString()
{
Assert.AreEqual("hello world", Basic.ToLowerCaseString(new string[] {"hello", "world"}));
Assert.AreEqual("hello world", Basic.ToLowerCaseString(new string[] {"HELLO", "WORLD"}));
Assert.AreEqual("", Basic.ToLowerCaseString(new string[] {}));
Assert.AreEqual("the apple is very juice", Basic.ToLowerCaseString(new string[] {"The", "Apple", "IS", "VERY", "juice"}));
Assert.AreEqual("a b c d e f g h i j k", Basic.ToLowerCaseString(new string[] {"A", "b", "C", "D", "E", "f", "G", "h", "i", "j", "K"}));
}
[Test]
public void TestIsUpperCase()
{
Assert.AreEqual(1, Basic.IsUpperCase("HELLO"));
Assert.AreEqual(1, Basic.IsUpperCase(" HELLO "));
Assert.AreEqual(1, Basic.IsUpperCase(" HELLO WORLD "));
Assert.AreEqual(0, Basic.IsUpperCase("hello"));
Assert.AreEqual(0, Basic.IsUpperCase("HeLLo"));
Assert.AreEqual(0, Basic.IsUpperCase(" HeLLo "));
Assert.AreEqual(0, Basic.IsUpperCase(" HELLO wORLD "));
Assert.AreEqual(0, Basic.IsUpperCase(" Hello wOrLD "));
Assert.AreEqual(-1, Basic.IsUpperCase(" "));
Assert.AreEqual(-1, Basic.IsUpperCase(" "));
Assert.AreEqual(-1, Basic.IsUpperCase(""));
Assert.AreEqual(-1, Basic.IsUpperCase(string.Empty));
Assert.AreEqual(-1, Basic.IsUpperCase(null));
}
[Test]
public void TestRemoveUnnecessarySpaces()
{
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces("Hello world"));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world"));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces("Hello world "));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world"));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world "));
Assert.AreEqual("Hello world", Basic.RemoveUnnecessarySpaces(" Hello world "));
Assert.AreEqual("the apple is very juice", Basic.RemoveUnnecessarySpaces(" the apple is very juice "));
Assert.AreEqual("", Basic.RemoveUnnecessarySpaces(" "));
Assert.AreEqual("", Basic.RemoveUnnecessarySpaces(" "));
}
}
}
• ConvertToInt
You will receive a text in which you need to convert to an int.
Input example: "105"
Output example: 105
All input will be valid numbers.
• TransformMinusIntoPlus
You will receive a text in which contains a single minus which needs to be replaced by a plus.
Input example: "111-333"
Output example: "111+333"
• ConvertToDouble
You will receive a text in which you need to convert to a double.
Input example: "15,2"
Output example: 15.2
All input will be numbers with either separator: , or .
• ReturnNumbersAsArray
You will receive a string with numbers which you will need to convert to an array of int.
Input example: "10 20 30 40 50"
Output Example: [10, 20, 30, 40, 50]
The input will always be valid numbers.
• ReturnNumbersAsString
You will receive an int array with numbers which you will need to convert to a single
string following the output example
Input example: [10, 20, 30, 40, 50]
Output Example: "10, 20, 30, 40, 50"
• RemoveDecimalPlace
You will be given a decimal number which you must remove the decimal places
Input example: 10.2
Output example: 10
• EquationResult
You will be given a text wich contains a equation with 2 numbers and one operator: + - * /
You should return the result of the equation
Input example: "10 + 2"
Output example: 12
All input will be valid equations.
If a division by zero would occur, you should return the constant double.NaN
public class Basic1
{
public static int ConvertToInt(string numberAsText)
{
return 0;
}
public static string TransformMinusIntoPlus(string text)
{
return "";
}
public static double ConvertToDouble(string numberAsText)
{
return 0;
}
public static int[] ReturnNumbersAsArray(string text)
{
return null;
}
public static string ReturnNumbersAsString(int [] numbers)
{
return "";
}
public static decimal RemoveDecimalPlace(decimal number)
{
return 0;
}
public static double EquationResult(string equation)
{
return 0;
}
}
namespace Solution {
using NUnit.Framework;
using System;
[TestFixture]
public class SolutionTest
{
[Test]
public void TestConvertToInt()
{
Assert.AreEqual(1, Basic1.ConvertToInt("1"));
Assert.AreEqual(-1, Basic1.ConvertToInt("-1"));
Assert.AreEqual(99, Basic1.ConvertToInt("99"));
Assert.AreEqual(2, Basic1.ConvertToInt("02"));
Assert.AreEqual(7, Basic1.ConvertToInt("007"));
}
[Test]
public void TestTransformMinusIntoPlus()
{
Assert.AreEqual("111+333", Basic1.TransformMinusIntoPlus("111-333"));
Assert.AreEqual("19+8745", Basic1.TransformMinusIntoPlus("19-8745"));
Assert.AreEqual("897+", Basic1.TransformMinusIntoPlus("897-"));
Assert.AreEqual("+", Basic1.TransformMinusIntoPlus("-"));
Assert.AreEqual("1+5", Basic1.TransformMinusIntoPlus("1-5"));
Assert.AreEqual("+1", Basic1.TransformMinusIntoPlus("-1"));
}
[Test]
public void TestConvertToDouble()
{
Assert.AreEqual(10.0, Basic1.ConvertToDouble("10"));
Assert.AreEqual(22.3, Basic1.ConvertToDouble("22.3"));
Assert.AreEqual(-7, Basic1.ConvertToDouble("-7"));
Assert.AreEqual(89, Basic1.ConvertToDouble("89,0"));
Assert.AreEqual(-8.9, Basic1.ConvertToDouble("-8,9"));
Assert.AreEqual(99.3, Basic1.ConvertToDouble("99.3"));
Assert.AreEqual(2.3, Basic1.ConvertToDouble("2,3"));
Assert.AreEqual(0, Basic1.ConvertToDouble("0.0"));
Assert.AreEqual(-19.8, Basic1.ConvertToDouble("-19.8"));
}
[Test]
public void TestReturnNumbersAsArray()
{
Assert.AreEqual(new int[] {10, 20, 30, 40, 50}, Basic1.ReturnNumbersAsArray("010 20 30 40 50"));
Assert.AreEqual(new int[] {44, 33, 55, 66, 89}, Basic1.ReturnNumbersAsArray("44 33 0055 66 89"));
Assert.AreEqual(new int[] {-1, 27, 987, -98, 98}, Basic1.ReturnNumbersAsArray("-1 27 987 -98 98"));
Assert.AreEqual(new int[] {67, 0, -10, -30, 67}, Basic1.ReturnNumbersAsArray("67 00 -10 -30 67"));
}
[Test]
public void TestReturnNumbersAsString()
{
Assert.AreEqual("10, 20, 30, 40, 50", Basic1.ReturnNumbersAsString(new int[] {10, 20, 30, 40, 50}));
Assert.AreEqual("44, 33, 55, 66, 89", Basic1.ReturnNumbersAsString(new int[] {44, 33, 55, 66, 89}));
Assert.AreEqual("-1, 27, 987, -98, 98", Basic1.ReturnNumbersAsString(new int[] {-1, 27, 987, -98, 98}));
Assert.AreEqual("67, 0, -10, -30, 67", Basic1.ReturnNumbersAsString(new int[] {67, 0, -10, -30, 67}));
}
[Test]
public void TestRemoveDecimalPlace()
{
Assert.AreEqual(0.0d, Basic1.RemoveDecimalPlace(0.0m));
Assert.AreEqual(10.0d, Basic1.RemoveDecimalPlace(10.2m));
Assert.AreEqual(-20, Basic1.RemoveDecimalPlace(-20.3m));
Assert.AreEqual(-789, Basic1.RemoveDecimalPlace(-789.954m));
Assert.AreEqual(347, Basic1.RemoveDecimalPlace(347.999m));
Assert.AreEqual(decimal.MaxValue, Basic1.RemoveDecimalPlace(decimal.MaxValue));
Assert.AreEqual(decimal.MinValue, Basic1.RemoveDecimalPlace(decimal.MinValue));
}
[Test]
public void TestEquationResult()
{
Assert.AreEqual(8, Basic1.EquationResult("10 - 2"));
Assert.AreEqual(-8, Basic1.EquationResult("-10 - -2"));
Assert.AreEqual(8, Basic1.EquationResult("+10 - +2"));
Assert.AreEqual(0, Basic1.EquationResult("+0 - -0"));
Assert.AreEqual(int.MaxValue - 1, Basic1.EquationResult(int.MaxValue + " - 1"));
Assert.AreEqual(12, Basic1.EquationResult("10 + 2"));
Assert.AreEqual(995, Basic1.EquationResult("999 + -4"));
Assert.AreEqual(-17, Basic1.EquationResult("-15 + -2"));
Assert.AreEqual(30, Basic1.EquationResult("-70 + 100"));
Assert.AreEqual(20, Basic1.EquationResult("10 * 2"));
Assert.AreEqual(-20, Basic1.EquationResult("-10 * 2"));
Assert.AreEqual(20, Basic1.EquationResult("-10 * -2"));
Assert.AreEqual(0, Basic1.EquationResult("-10 * 0"));
Assert.AreEqual(5, Basic1.EquationResult("10 / 2"));
Assert.AreEqual(-5, Basic1.EquationResult("10 / -2"));
Assert.AreEqual(5, Basic1.EquationResult("-10 / -2"));
Assert.AreEqual(33.333333333333336d, Basic1.EquationResult("100 / 3"));
Assert.AreEqual(double.NaN, Basic1.EquationResult("100 / 0"));
}
}
}