Exemplo n.º 1
0
 public void TestNextBiggerNumber()
 {
     //SampleTests
     //Assert.AreEqual(21, BiggerNumber.NextBiggerNumber(12));
     //Assert.AreEqual(531, BiggerNumber.NextBiggerNumber(513));
     //Assert.AreEqual(2071, BiggerNumber.NextBiggerNumber(2017));
     Assert.AreEqual(441, BiggerNumber.NextBiggerNumber(414));
     Assert.AreEqual(414, BiggerNumber.NextBiggerNumber(144));
 }
Exemplo n.º 2
0
 public void SuccsesfullTests()
 {
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(12).Item1, 21);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(513).Item1, 531);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(2017).Item1, 2071);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(414).Item1, 441);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(144).Item1, 414);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(1234321).Item1, 1241233);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(1234126).Item1, 1234162);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(3456432).Item1, 3462345);
 }
Exemplo n.º 3
0
        public void BiggerNumber_FindNextBiggerNumberWithTime_Tuple()
        {
            int       number    = 1234321;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            Tuple <int, TimeSpan> nextBiggerAndTime = BiggerNumber.FindNextBiggerNumberWithTime(number);

            stopwatch.Stop();
            Assert.LessOrEqual(nextBiggerAndTime.Item2, stopwatch.Elapsed);
        }
Exemplo n.º 4
0
        public void BiggerNumber_FindNextBiggerNumberWithTime_OutParameter()
        {
            int       number    = 1234321;
            Stopwatch stopwatch = new Stopwatch();
            TimeSpan  findTime  = new TimeSpan();

            stopwatch.Start();
            int nextBiggerNumber = BiggerNumber.FindNextBiggerNumberWithTime(number, out findTime);

            stopwatch.Stop();
            Assert.LessOrEqual(findTime, stopwatch.Elapsed);
        }
Exemplo n.º 5
0
 public int BiggerNumber_FindNextBiggerNumber(int number)
 {
     return(BiggerNumber.FindNextBiggerNumber(number));
 }
Exemplo n.º 6
0
 public void NegativeArgument()
 {
     BiggerNumber.FindNextBiggerNumber(-10);
 }
Exemplo n.º 7
0
 public void UnsuccsesfullTests()
 {
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(10).Item1, -1);
     Assert.AreEqual(BiggerNumber.FindNextBiggerNumber(20).Item1, -1);
 }
        public void findnimber513Expected531()
        {
            long a = 0;

            Assert.AreEqual(531, BiggerNumber.findnimber(513, out a));
        }
        public void findnimber3456432Expected3462345()
        {
            long a = 0;

            Assert.AreEqual(3462345, BiggerNumber.findnimber(3456432, out a));
        }
        public void findnimber1234126Expected1234162()
        {
            long a = 0;

            Assert.AreEqual(1234162, BiggerNumber.findnimber(1234126, out a));
        }
        public void findnimber1234321Expected1241233()
        {
            long a = 0;

            Assert.AreEqual(1241233, BiggerNumber.findnimber(1234321, out a));
        }
        public void findnimber144Expected414()
        {
            long a = 0;

            Assert.AreEqual(414, BiggerNumber.findnimber(144, out a));
        }
        public void findnimber414Expected441()
        {
            long a = 0;

            Assert.AreEqual(441, BiggerNumber.findnimber(414, out a));
        }
        public void findnimber2017Expected2071()
        {
            long a = 0;

            Assert.AreEqual(2071, BiggerNumber.findnimber(2017, out a));
        }
        public void findnimber20Expectedmin1()
        {
            long a = 0;

            Assert.AreEqual(-1, BiggerNumber.findnimber(20, out a));
        }
Exemplo n.º 16
0
 public BiggerNumberTest()
 {
     _biggerNumber = new BiggerNumber();
 }
        public void findnimber12Expected21()
        {
            long a = 0;

            Assert.AreEqual(21, BiggerNumber.findnimber(12, out a));
        }