public void StepNameToMethodName_ShouldReturnLegalMethodName()
        {
            SnippetBuilder sb       = new SnippetBuilder();
            string         stepName = "we're all wired";

            Assert.That(sb.StepNameToMethodName(stepName), Is.EqualTo("WereAllWired"));
        }
        public void StepNameToMethodName_ShouldReturnLegalMethodName_TrailingComma()
        {
            SnippetBuilder sb       = new SnippetBuilder();
            string         stepName = "the separator is ,";

            Assert.That(sb.StepNameToMethodName(stepName), Is.EqualTo("TheSeparatorIs"));
        }
Ejemplo n.º 3
0
        public void SnippetBuilder_BuildsSnippet()
        {
            // Arrange
            var title       = "test title";
            var author      = "test author";
            var description = "test description";
            var shortcut    = "test shortcut";
            var language    = "test language";
            var code        = "do this();";

            var declaration1 = new Declaration("1", "default 1");
            var declaration2 = new Declaration("2", "default 2", "tool tip 2");
            var declarations = new List <Declaration>()
            {
                declaration1,
                declaration2
            };

            var expected = $"{title}{author}{description}{shortcut}{language}{code}{declaration1.ID}" +
                           $"{declaration1.DefaultValue}{declaration2.ID}{declaration2.DefaultValue}{declaration2.ToolTip}";

            var builder = new SnippetBuilder(dataAccess.Object);

            // Act
            var snippet = builder.GenerateSnippet(title, author, description, shortcut, language, code, declarations);

            // Assert
            Assert.AreEqual(expected, snippet);
        }