Example #1
0
 private static void dotest(int[] ls, int[] exp)
 {
     int[] ans = Kata.PartsSums(ls);
     Assert.AreEqual(exp, ans);
 }
Example #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[] { }));
 }
Example #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 }));
 }
Example #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 }));
 }
 public void SumOfStrings(string result, string first, string second)
 {
     Assert.AreEqual(result, Kata.sumStrings(first, second));
 }
 public void SadPath1()
 {
     Assert.IsFalse(Kata.isMerge("codewars", "cod", "wars"), "Codewars are not codwars");
 }
Example #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(""));
 }
Example #9
0
 public void TestBigNumbers()
 {
     Assert.AreEqual(59884848483559, Kata.NextBiggerNumber(59884848459853));
     Assert.AreEqual(536479, Kata.NextBiggerNumber(534976));
     Assert.AreEqual(251678, Kata.NextBiggerNumber(218765));
 }
 public void HappyPath2()
 {
     Assert.IsTrue(Kata.isMerge("codewars", "cdwr", "oeas"), "codewars can be created from cdwr and oeas");
 }
Example #11
0
 public void TestInvalidNumbers()
 {
     Assert.AreEqual(-1, Kata.NextBiggerNumber(9));
     Assert.AreEqual(-1, Kata.NextBiggerNumber(111));
     Assert.AreEqual(-1, Kata.NextBiggerNumber(531));
 }
Example #12
0
 public void Test1()
 {
     int[] peopleInLine = new int[] { 25, 25, 50, 50 };
     Assert.AreEqual("YES", Kata.Tickets(peopleInLine));
 }
Example #13
0
 public void Test2()
 {
     int[] peopleInLine = new int[] { 25, 100 };
     Assert.AreEqual("NO", Kata.Tickets(peopleInLine));
 }
Example #14
0
        public void TestHigherNumbers()
        {
            int result = Kata.LoseFives(4, 17);

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

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