Ejemplo n.º 1
0
 private static void dotest(int[] ls, int[] exp)
 {
     int[] ans = Kata.PartsSums(ls);
     Assert.AreEqual(exp, ans);
 }
Ejemplo n.º 2
0
 public void BasicTests()
 {
     Assert.AreEqual(new int[] { 1, 3, 2, 8, 5, 4 }, Kata.SortArray(new int[] { 5, 3, 2, 8, 1, 4 }));
     Assert.AreEqual(new int[] { 1, 3, 5, 8, 0 }, Kata.SortArray(new int[] { 5, 3, 1, 8, 0 }));
     Assert.AreEqual(new int[] { }, Kata.SortArray(new int[] { }));
 }
Ejemplo n.º 3
0
 public void SampleTest()
 {
     Assert.AreEqual(9, Kata.Solution(new int[] { 1, 2, 3 }, new int[] { 4, 5, 6 }));
     Assert.AreEqual(16.5, Kata.Solution(new int[] { 10, 20, 10, 2 }, new int[] { 10, 25, 5, -2 }));
     Assert.AreEqual(1, Kata.Solution(new int[] { 0, -1 }, new int[] { -1, 0 }));
 }
Ejemplo n.º 4
0
 public void Test1()
 {
     Assert.AreEqual("ROT13 example.", Kata.Rot13("EBG13 rknzcyr."));
 }
 public void SampleTest()
 {
     Assert.AreEqual(28, Kata.CubeOdd(new int[] { 1, 2, 3, 4 }));
     Assert.AreEqual(0, Kata.CubeOdd(new int[] { -3, -2, 2, 3 }));
 }
Ejemplo n.º 6
0
 public void SumOfStrings(string result, string first, string second)
 {
     Assert.AreEqual(result, Kata.sumStrings(first, second));
 }
Ejemplo n.º 7
0
 public void SadPath1()
 {
     Assert.IsFalse(Kata.isMerge("codewars", "cod", "wars"), "Codewars are not codwars");
 }
Ejemplo n.º 8
0
 public void SampleTest()
 {
     Assert.AreEqual("Thi1s is2 3a T4est", Kata.Order("is2 Thi1s T4est 3a"));
     Assert.AreEqual("Fo1r the2 g3ood 4of th5e pe6ople", Kata.Order("4of Fo1r pe6ople g3ood th5e the2"));
     Assert.AreEqual("", Kata.Order(""));
 }
Ejemplo n.º 9
0
 public void TestBigNumbers()
 {
     Assert.AreEqual(59884848483559, Kata.NextBiggerNumber(59884848459853));
     Assert.AreEqual(536479, Kata.NextBiggerNumber(534976));
     Assert.AreEqual(251678, Kata.NextBiggerNumber(218765));
 }
Ejemplo n.º 10
0
 public void HappyPath2()
 {
     Assert.IsTrue(Kata.isMerge("codewars", "cdwr", "oeas"), "codewars can be created from cdwr and oeas");
 }
Ejemplo n.º 11
0
 public void TestInvalidNumbers()
 {
     Assert.AreEqual(-1, Kata.NextBiggerNumber(9));
     Assert.AreEqual(-1, Kata.NextBiggerNumber(111));
     Assert.AreEqual(-1, Kata.NextBiggerNumber(531));
 }
Ejemplo n.º 12
0
 public void Test1()
 {
     int[] peopleInLine = new int[] { 25, 25, 50, 50 };
     Assert.AreEqual("YES", Kata.Tickets(peopleInLine));
 }
Ejemplo n.º 13
0
 public void Test2()
 {
     int[] peopleInLine = new int[] { 25, 100 };
     Assert.AreEqual("NO", Kata.Tickets(peopleInLine));
 }
Ejemplo n.º 14
0
        public void TestHigherNumbers()
        {
            int result = Kata.LoseFives(4, 17);

            Assert.AreEqual(12, result);
        }
Ejemplo n.º 15
0
 public void HappyPath1()
 {
     Assert.IsTrue(Kata.isMerge("codewars", "code", "wars"), "codewars can be created from code and wars");
 }
Ejemplo n.º 16
0
        public void TestWithoutFives()
        {
            int result = Kata.LoseFives(0, 4);

            Assert.AreEqual(5, result);
        }
Ejemplo n.º 17
0
 public void EmptyTest(string input, string expected)
 {
     Assert.AreEqual(Kata.UniqueInOrder(input), expected);
 }