Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using _04.SameIntCounter;
- namespace _04a.UnitTest
- {
- [TestClass]
- public class UnitTest
- {
- static int maxValue = int.MaxValue;
- static int minValue = int.MinValue;
- [TestMethod]
- public void TestWithMinValue()
- {
- int[] array = { maxValue, minValue, 7, minValue, 2 };
- SameIntCounter.searchedNumber = minValue;
- SameIntCounter.CheckTheDigits(array);
- Assert.AreEqual(2, SameIntCounter.counter);
- SameIntCounter.counter = 0;
- }
- public void TestWithMaxValue()
- {
- int[] array = { 17, 101, 70, 101, maxValue, maxValue, maxValue, 0 };
- SameIntCounter.searchedNumber = maxValue;
- SameIntCounter.CheckTheDigits(array);
- Assert.AreEqual(3, SameIntCounter.counter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement