public void Generate_AddsConstructorWithBaseCall_PassingIPublishedContentParameter() { var type = new CodeTypeDeclaration{Name="AName"}; type.BaseTypes.Add("ABaseType"); var generator = new CtorGenerator(null); generator.Generate(type, new MediaType()); var ns = CodeGenerationHelper.CreateNamespaceWithType(type); var code = CodeGenerationHelper.GenerateCode(ns); Assert.AreEqual( @"//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace ANamespace { public class AName : ABaseType { public AName(IPublishedContent content) : base(content) { } } } ", code.ToString()); }
public void Generate_AddsConstructorWithBaseCall_PassingIPublishedContentParameter() { var type = new CodeTypeDeclaration{Name="AName"}; type.BaseTypes.Add("ABaseType"); var generator = new CtorGenerator(null); generator.Generate(type, new MediaType()); var ns = CodeGenerationHelper.CreateNamespaceWithType(type); var code = CodeGenerationHelper.GenerateCode(ns); Assert.AreEqual( @"namespace ANamespace { public class AName : ABaseType { public AName(IPublishedContent content) : base(content) { } } } ", code.ToString()); }