Example #1
0
 public void IsCubicNumberTest()
 {
     Assert.AreEqual(Cubes.IsCubicNumber("902"), false);
     Assert.AreEqual(Cubes.IsCubicNumber("631"), false);
     Assert.AreEqual(Cubes.IsCubicNumber("153"), true);
     Assert.AreEqual(Cubes.IsCubicNumber("0"), true);
     Assert.AreEqual(Cubes.IsCubicNumber("1"), true);
 }
Example #2
0
 public void GetNumbersTest()
 {
     CollectionAssert.AreEqual(Cubes.GetNumbers("0 9026315 -827&()"), new List <string>()
     {
         "0", "902", "631", "5", "827"
     });
     CollectionAssert.AreEqual(Cubes.GetNumbers("aqdf&0#1xyz!22[153(777.777"), new List <string>()
     {
         "0", "1", "22", "153", "777", "777"
     });
     CollectionAssert.AreEqual(Cubes.GetNumbers("QK29a45[&erui9026315"), new List <string>()
     {
         "29", "45", "902", "631", "5"
     });
 }
Example #3
0
 public void Test()
 {
     Assert.AreEqual(Cubes.IsSumOfCubes("0 9026315 -827&()"), "0 0 Lucky");
     Assert.AreEqual(Cubes.IsSumOfCubes("aqdf&0#1xyz!22[153(777.777"), "0 1 153 154 Lucky");
     Assert.AreEqual(Cubes.IsSumOfCubes("QK29a45[&erui9026315"), "Unlucky");
 }