Advertisement
BackoChan

Task 4 UnitTest

Dec 20th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using _04.SameIntCounter;
  4.  
  5. namespace _04a.UnitTest
  6. {
  7.     [TestClass]
  8.     public class UnitTest
  9.     {
  10.         static int maxValue = int.MaxValue;
  11.         static int minValue = int.MinValue;
  12.  
  13.         [TestMethod]
  14.         public void TestWithMinValue()
  15.         {
  16.             int[] array = { maxValue, minValue, 7, minValue, 2 };
  17.  
  18.             SameIntCounter.searchedNumber = minValue;
  19.             SameIntCounter.CheckTheDigits(array);
  20.  
  21.             Assert.AreEqual(2, SameIntCounter.counter);
  22.  
  23.             SameIntCounter.counter = 0;
  24.         }
  25.  
  26.         public void TestWithMaxValue()
  27.         {
  28.             int[] array = { 17, 101, 70, 101, maxValue, maxValue, maxValue, 0 };
  29.  
  30.             SameIntCounter.searchedNumber = maxValue;
  31.             SameIntCounter.CheckTheDigits(array);
  32.  
  33.             Assert.AreEqual(3, SameIntCounter.counter);
  34.  
  35.            
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement