Exemplo n.º 1
0
        public void ShortName()
        {
            Stitch stitch = new Stitch();

            string expected = "blankStitch";
            string name     = stitch.CreateShortName();

            Assert.AreEqual(expected, name);

            stitch.Text = "!!!";
            expected    = "punctuatedStitch";
            name        = stitch.CreateShortName();
            Assert.AreEqual(expected, name);

            stitch.Text = "A brand! NEW short name.";
            expected    = "aBrandNewShortNa";
            name        = stitch.CreateShortName();
            Assert.AreEqual(expected, name,
                            string.Format("Expected short name '{0}', found '{1}'", expected, stitch.Name));
        }