1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using Library;
- namespace TestMethodsLibrary.Test
- {
- [TestClass]
- public class UnitTest1
- {
- [TestMethod]
- public void TestMethod_CreateStack_ExeptedStack3Values_ResultStack3Values()
- {
- Stack<double> exepted = new Stack<double>();
- exepted.Push(-1);
- exepted.Push(-2);
- exepted.Push(-3);
- Stack<double> result = new Stack<double>();
- MethodExamTask methodExamTask = new MethodExamTask();
- result = methodExamTask.AddValueInStack(-1, result);
- result = methodExamTask.AddValueInStack(-2, result);
- result = methodExamTask.AddValueInStack(-3, result);
- CollectionAssert.AreEquivalent(exepted, result);
- }
- [TestMethod]
- public void TestMethod_CountOtricNumInStack_Exepted2_Result2()
- {
- int exepted = 2;
- MethodExamTask methodExamTask = new MethodExamTask();
- Stack<double> stackResult = new Stack<double>();
- stackResult = methodExamTask.AddValueInStack(-1, stackResult);
- stackResult = methodExamTask.AddValueInStack(-2, stackResult);
- stackResult = methodExamTask.AddValueInStack(5, stackResult);
- int result = methodExamTask.CountOtricNumInStack(stackResult);
- Assert.AreEqual(exepted, result);
- }
- [TestMethod]
- public void TestMethod_CountSumOricNumInStack_ExeptedMinus11_ResultMinus11()
- {
- int exepted = -11;
- MethodExamTask methodExamTask = new MethodExamTask();
- Stack<double> stackResult = new Stack<double>();
- stackResult = methodExamTask.AddValueInStack(-5, stackResult);
- stackResult = methodExamTask.AddValueInStack(-6, stackResult);
- stackResult = methodExamTask.AddValueInStack(43, stackResult);
- double result = methodExamTask.CountSumOricNumInStack(stackResult);
- Assert.AreEqual(exepted, result);
- }
- }
- }
|