public TokenTests(TokenTestsFixture fixture) { this._fixture = fixture; var token = new LaunchPadToken(); this._fixture.Initialize(token); }
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); }
public void Initialize(LaunchPadToken token) { SUT = token; }