using Library; namespace TestMethodsLibrary.Test { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod_CreateStack_ExeptedStack3Values_ResultStack3Values() { Stack exepted = new Stack(); exepted.Push(-1); exepted.Push(-2); exepted.Push(-3); Stack result = new Stack(); 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 stackResult = new Stack(); 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 stackResult = new Stack(); stackResult = methodExamTask.AddValueInStack(-5, stackResult); stackResult = methodExamTask.AddValueInStack(-6, stackResult); stackResult = methodExamTask.AddValueInStack(43, stackResult); double result = methodExamTask.CountSumOricNumInStack(stackResult); Assert.AreEqual(exepted, result); } } }