示例#1
0
        public void MSUnitTest_Insert_CorrectInputValues_PositiveTest()
        {
            int actual;
            int expected = Convert.ToInt32(TestContext.DataRow["ExpectedResult"]);

            actual = nextNumber.FindNextBiggerNumber(Convert.ToInt32(TestContext.DataRow["Actual"]));

            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        /// The method realizes the time interval of searching for the bigger number.
        /// </summary>
        /// <param name="args">The received arguments.</param>
        public static void Main(string[] args)
        {
            NextBiggerNumber nextNumber = new NextBiggerNumber();

            Console.WriteLine(NextBiggerNumber.FindNextBiggerNumberTiming(nextNumber.FindNextBiggerNumber(4138)));
            Console.WriteLine(NextBiggerNumber.FindNextBiggerNumberTiming(nextNumber.FindNextBiggerNumber(-345)));
            Console.WriteLine(NextBiggerNumber.FindNextBiggerNumberTiming(nextNumber.FindNextBiggerNumber(7255)));
            Console.ReadKey();
        }
        public void FindNextBiggerNumber_GivenNumberHasResult_ReturnsFalse(long number, long result)
        {
            // Arrange
            var nextBiggerNumber = new NextBiggerNumber();

            // Act
            var actual = nextBiggerNumber.FindNextBiggerNumber(number);

            // Assert
            Assert.AreEqual(result, actual);
        }
示例#4
0
 public void FindNextBiggerNumber_NegativeNumbers_ArgumentOutOfRangeException(int number)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => NextBiggerNumber.FindNextBiggerNumber(number));
 }
示例#5
0
 public int FindNextBiggerNumber_Number_Success(int number)
 {
     return(NextBiggerNumber.FindNextBiggerNumber(number));
 }
 public int FindNextBiggerNumber_AllVariants(int number)
 {
     return(nextNumber.FindNextBiggerNumber(number));
 }