Sha256: b0928c1a63f1b325ab9ce041f22b153236650e42ff9fd836ae8acedf0f5b6427
Contents?: true
Size: 1.94 KB
Versions: 166
Compression:
Stored size: 1.94 KB
Contents
using Generators.Input; namespace Generators.Output { public abstract class TestMethodBody { protected TestMethodBody(CanonicalDataCase canonicalDataCase, CanonicalData canonicalData) { CanonicalDataCase = canonicalDataCase; CanonicalData = canonicalData; Data = new TestMethodBodyData(this); InitializeTemplateParameters(); } public string TemplateName { get; set; } = "TestMethodBody"; public CanonicalDataCase CanonicalDataCase { get; } public CanonicalData CanonicalData { get; } public TestMethodBodyData Data { get; } public virtual bool UseVariablesForInput => CanonicalDataCase.UseVariablesForInput; public virtual bool UseVariablesForConstructorParameters => CanonicalDataCase.UseVariablesForConstructorParameters; public virtual bool UseVariableForExpected => CanonicalDataCase.UseVariableForExpected; public virtual bool UseVariableForTested => CanonicalDataCase.UseVariableForTested; public string ArrangeTemplateName { get; set; } = "Arrange"; public object ArrangeTemplateParameters { get; set; } public string ActTemplateName { get; set; } = "Act"; public object ActTemplateParameters { get; set; } public string AssertTemplateName { get; set; } = "AssertEqual"; public object AssertTemplateParameters { get; set; } public string Act { get; set; } public string Arrange { get; set; } public string Assert { get; set; } public virtual string Render() => TemplateRenderer.RenderPartial(TemplateName, new { Arrange, Act, Assert }); private void InitializeTemplateParameters() { ArrangeTemplateParameters = new { Data.Variables }; ActTemplateParameters = new { }; AssertTemplateParameters = new { Data.ExpectedParameter, Data.TestedValue }; } } }
Version data entries
166 entries across 166 versions & 1 rubygems