Exemple #1
0
        public void Compress2()
        {
            var compress = new StringCompressionClass();
            var expected = "r4b1k8";
            var actual   = compress.Compress("rrrrbkkkkkkkk");

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void CompressCaseSensitive()
        {
            var compress = new StringCompressionClass();
            var expected = "G3r1h2I9b2";
            var actual   = compress.Compress("GGGrhhIIIIIIIIIbb");

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void Compress()
        {
            var compress = new StringCompressionClass();
            var expected = "a3b2";
            var actual   = compress.Compress("aaabb");

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void Compress3()
        {
            var compress = new StringCompressionClass();
            var expected = "reb"; //this test is testing the condition of the uncompressed string being shorter than the compressed string
            //without this condition, the compressed string would have been "r1e1b1"
            var actual = compress.Compress("reb");

            Assert.AreEqual(expected, actual);
        }