예제 #1
0
        public TokenTests(TokenTestsFixture fixture)
        {
            this._fixture = fixture;
            var token = new LaunchPadToken();

            this._fixture.Initialize(token);
        }
예제 #2
0
        public void Should_Match_Tokens()
        {
            string originalText   = @"using System.Collections.Generic;
                                    using System.ComponentModel.DataAnnotations.Schema;
                                    using DeploySoftware.LaunchPad.Core.Domain;

                                    namespace {{p:dss|n:domain_namespace}}
                                    {
                                        /// <summary>
                                        /// {{p:dss|n:domain_entity_description}}
                                        /// </summary>
                                        {{p:dss|n:domain_entity_annotations}}
                                        public class {{p:dss|n:domain_entity_name}} : {{p:dss|n:domain_entity_inherits_from|dv:IDomainEntity<TIdType>}}
                                        {
                                            /// <summary>
                                            /// Creates a default {{p:dss|n:domain_entity_name}} entity
                                            /// </summary>
                                            public {{p:dss|n:domain_entity_name}}() : base()
                                            {

                                            }
                                        }
                                    }";
            string expectedResult = @"using System.Collections.Generic;
                                    using System.ComponentModel.DataAnnotations.Schema;
                                    using DeploySoftware.LaunchPad.Core.Domain;

                                    namespace Deploy.DeploymentGateway
                                    {
                                        /// <summary>
                                        /// {{p:dss|n:domain_entity_description}}
                                        /// </summary>
                                        {{p:dss|n:domain_entity_annotations}}
                                        public class {{p:dss|n:domain_entity_name}} : {{p:dss|n:domain_entity_inherits_from|dv:IDomainEntity<TIdType>}}
                                        {
                                            /// <summary>
                                            /// Creates a default {{p:dss|n:domain_entity_name}} entity
                                            /// </summary>
                                            public {{p:dss|n:domain_entity_name}}() : base()
                                            {

                                            }
                                        }
                                    }";
            var    token          = new LaunchPadToken("{{p:dss|n:domain_namespace}}");

            token.Value = "Deploy.DeploymentGateway";
            IDictionary <string, LaunchPadToken> tokens = new Dictionary <string, LaunchPadToken>();

            tokens.Add(token.Name, token);
            LaunchPadTokenizer tokenizer = new LaunchPadTokenizer();

            tokenizer.Tokenize(originalText, tokens);
            Assert.Equal(expectedResult, tokenizer.TokenizedText);
        }
예제 #3
0
 public void Initialize(LaunchPadToken token)
 {
     SUT = token;
 }