コード例 #1
0
        public void TestCountAndSay()
        {
            CountAndSay countSay = new CountAndSay();

            Assert.Equal("1", countSay.CountAndSayProblem(1));
            Assert.Equal("11", countSay.CountAndSayProblem(2));
            Assert.Equal("21", countSay.CountAndSayProblem(3));
            Assert.Equal("1211", countSay.CountAndSayProblem(4));
        }
コード例 #2
0
        public void Excution1Test()
        {
            var func = new CountAndSay();

            Assert.AreEqual("1", func.Excution1(1));
            Assert.AreEqual("11", func.Excution1(2));
            Assert.AreEqual("21", func.Excution1(3));
            Assert.AreEqual("1211", func.Excution1(4));
            Assert.AreEqual("111221", func.Excution1(5));
        }
コード例 #3
0
        public void TestCountAndSay()
        {
            var r = CountAndSay.BabySay(3);

            Assert.AreEqual(r, "21");

            r = CountAndSay.BabySay(5);
            Assert.AreEqual(r, "111221");

            r = CountAndSay.BabySay(6);
            Assert.AreEqual(r, "312211");

            r = CountAndSay.BabySay(7);
            Assert.AreEqual(r, "13112221");

            r = CountAndSay.BabySay(8);
            Assert.AreEqual(r, "1113213211");
        }
コード例 #4
0
ファイル: CountAndSayUnitTest.cs プロジェクト: zltma/Leetcode
 public void BeforeEach()
 {
     CountAndSay = new CountAndSay();
 }
コード例 #5
0
        public void Solution1Test()
        {
            CountAndSay myCas = new CountAndSay();

            Assert.AreEqual("111221", myCas.Solution1(5));
        }