/// <summary> /// Transform Mobioos types to TypeScript types. /// </summary> /// <param name="apiParameter">A Mobioos api action parameter.</param> /// <returns>A TypeScript type in string.</returns> public static string TypeScriptType(this ApiParameterInfo apiParameter) { if (!apiParameter.IsValid()) { return(null); } return(apiParameter.Type.TypeScriptType()); }
/// <summary> /// Check if the given type is a primitive type. /// </summary> /// <param name="property">A ApiParameterInfo object.</param> /// <returns>A boolean.</returns> public static bool IsPrimitiveType(this ApiParameterInfo apiParameter) { if (!apiParameter.IsValid()) { return(false); } return(apiParameter.Type.IsPrimitiveType()); }
/// <summary> /// Transform Mobioos types to C# types. /// </summary> /// <param name="apiParameter">A Mobioos api action parameter.</param> /// <returns>A C# type in string.</returns> public static string CSharpType(this ApiParameterInfo apiParameter) { if (!apiParameter.IsValid()) { return(null); } return(apiParameter.Type.CSharpType()); }
public static bool IsValid(this ApiParameterInfo apiParameter) { if (apiParameter == null || !apiParameter.Id.IsValid()) { return(false); } return(true); }
/// <summary> /// Check if the given type is a model. /// </summary> /// <param name="property">A ApiParameterInfo object.</param> /// <returns>A boolean.</returns> public static bool IsModel(this ApiParameterInfo apiParameter) { if (!apiParameter.IsValid()) { return(false); } if (!apiParameter.IsPrimitiveType() && apiParameter.DataModel.IsValid()) { return(true); } return(false); }
public void ProcessRequest(HttpContext context) { RequestModel requestModel = new RequestModel(); try { requestModel = ZentCloud.Common.JSONHelper.JsonToModel <RequestModel>(context.Request["data"]); } catch (Exception) { apiResp.msg = "JSON格式错误,请检查"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.PrimaryKeyIncomplete; bllApi.ContextResponse(context, apiResp); return; } if (requestModel.api_id <= 0) { apiResp.msg = "api_id参数为必填项,请检查"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bllApi.ContextResponse(context, apiResp); return; } if (string.IsNullOrEmpty(requestModel.parameter_name)) { apiResp.msg = "parameter_name参数为必填项,请检查"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bllApi.ContextResponse(context, apiResp); return; } ApiParameterInfo model = new ApiParameterInfo(); model.ApiId = requestModel.api_id; model.IsNull = requestModel.parameter_isnull; model.ParameterName = requestModel.parameter_name; model.DataType = requestModel.data_type; model.Description = requestModel.parameter_desc; if (bllApi.Add(model)) { apiResp.status = true; apiResp.msg = "ok"; } else { apiResp.msg = "操作出错"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail; } bllApi.ContextResponse(context, apiResp); }
private Dictionary <string, string> GetAllReferencedTypes(ApiParameterInfo param) { Dictionary <string, string> entityTypes = GetAllReferencedTypes(param.DataModel); var type = GetTypeFromProperty(param.ModelProperty); if (!entityTypes.ContainsKey(type) && !string.IsNullOrEmpty(type)) { entityTypes.Add(type, param.Id); } if (!_serviceTypes.ContainsKey(type) && !string.IsNullOrEmpty(type)) { _serviceTypes.Add(type, param.Id); } return(entityTypes); }
/// <summary> /// Retrieve all direct references from api action parameters. /// </summary> /// <param name="apiParameter">An ApiParameterInfo object.</param> /// <returns>A list of EntityInfo;</returns> public static List <EntityInfo> GetApiParameterDirectReferences(this ApiParameterInfo apiParameter) { var directReferences = new List <EntityInfo>(); if (!apiParameter.IsValid()) { return(directReferences); } var entityComparer = new EntityInfoComparer(); if (apiParameter.DataModel.IsValid() && apiParameter.DataModel.References != null) { directReferences = directReferences .Union( apiParameter.DataModel.GetEntityDirectReferences(), entityComparer) .ToList(); } return(directReferences); }
/// <summary> /// Create the template output /// </summary> public override string TransformText() { this.Write("\r\n"); this.Write(@"/* * You should add your licence here, here is an example : * * SonarQube, open source software quality management tool. * Copyright (C) 2008-2013 SonarSource * mailto:contact AT sonarsource DOT com * * SonarQube is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * SonarQube is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; "); #line 27 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (_viewModels.AsEnumerable() != null) { foreach (string viewModel in _viewModels.AsEnumerable()) { #line default #line hidden this.Write("import { "); #line 33 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(viewModel))); #line default #line hidden this.Write(" } from \'../viewModels/"); #line 33 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(viewModel))); #line default #line hidden this.Write("\';\r\n"); #line 34 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } #line default #line hidden this.Write("\r\nimport { DataService } from \'./data.service\';\r\n\r\n"); #line 41 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (_api.Id != null) { #line default #line hidden this.Write("/**\r\n * class: "); #line 46 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(".\r\n"); #line 47 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (_api.Description != null) { #line default #line hidden this.Write(" * "); #line 51 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(_api.Description)); #line default #line hidden this.Write(".\r\n * This service is generated from API domain.\r\n"); #line 53 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" * You should add a description of your service here.\r\n * This service is generat" + "ed from API domain.\r\n"); #line 60 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } #line default #line hidden this.Write(" */\r\n@Injectable()\r\nexport class "); #line 65 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(" {\r\n"); #line 66 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (_api.Actions.AsEnumerable() != null) { foreach (ApiActionInfo action in _api.Actions.AsEnumerable()) { if (action.Id != null && action.Url != null) { #line default #line hidden this.Write(" public _"); #line 74 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api = \'"); #line 74 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(action.Url)); #line default #line hidden this.Write("\';\r\n"); #line 75 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" constructor(public _dataService: DataService){}\r\n"); #line 81 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (_api.Actions.AsEnumerable() != null) { foreach (ApiActionInfo action in _api.Actions.AsEnumerable()) { if (action.Id != null && action.Url != null && action.Type != null) { #line default #line hidden this.Write(" /**\r\n * method: "); #line 90 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write(".\r\n * You should add a description of your method here.\r\n * That method s" + "hould be used to connect with generated\r\n * backend API. You should add busi" + "ness logic inside.\r\n"); #line 94 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); #line default #line hidden this.Write(" * @param "); #line 103 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param `"); #line 103 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write("`.\r\n"); #line 104 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } if (action.ReturnType != null && action.ReturnType.Id != null) { #line default #line hidden this.Write(" * @returns `"); #line 111 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.ReturnType.Id))); #line default #line hidden this.Write(">`.\r\n"); #line 112 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } #line default #line hidden this.Write(" */\r\n public "); #line 116 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 117 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 129 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param: "); #line 129 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write("\r\n"); #line 130 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 135 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param: "); #line 135 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write(",\r\n"); #line 136 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } } if (action.ReturnType != null && action.ReturnType.Id != null) { #line default #line hidden this.Write(" ): Observable<"); #line 145 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.ReturnType.Id))); #line default #line hidden this.Write("> {\r\n"); #line 146 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" ) {\r\n"); #line 152 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } switch (action.Type) { case "dataget": case "datalist": #line default #line hidden this.Write(" return this._dataService.get(\r\n"); #line 160 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" `${this._"); #line 164 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {\r\n"); #line 166 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 175 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": JSON.stringify("); #line 175 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param)\r\n"); #line 176 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 181 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": JSON.stringify("); #line 181 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param),\r\n"); #line 182 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" });\r\n"); #line 188 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" `${this._"); #line 193 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {});\r\n"); #line 195 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } break; case "datacreate": #line default #line hidden this.Write(" return this._dataService.post(\r\n"); #line 202 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" `${this._"); #line 206 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {\r\n"); #line 208 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 217 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 217 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param\r\n"); #line 218 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 223 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 223 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param,\r\n"); #line 224 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" },\r\n {});\r\n"); #line 231 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" `${this._"); #line 236 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {},\r\n {});\r\n"); #line 239 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } break; case "dataupdate": #line default #line hidden this.Write(" return this._dataService.put(\r\n"); #line 246 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" `${this._"); #line 250 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {\r\n"); #line 252 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 261 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 261 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param\r\n"); #line 262 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 267 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 267 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param,\r\n"); #line 268 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" },\r\n {});\r\n"); #line 275 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" `${this._"); #line 280 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {},\r\n {});\r\n"); #line 283 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } break; case "datadelete": #line default #line hidden this.Write(" return this._dataService.delete(\r\n"); #line 290 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" `${this._"); #line 294 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {\r\n"); #line 296 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 305 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": JSON.stringify("); #line 305 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param)\r\n"); #line 306 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 311 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": JSON.stringify("); #line 311 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param),\r\n"); #line 312 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" });\r\n"); #line 318 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" `${this._"); #line 323 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {});\r\n"); #line 325 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } break; default: break; } #line default #line hidden this.Write(" }\r\n"); #line 333 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write("}\r\n"); #line 339 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\API\Templates\ApiTemplate.tt" } #line default #line hidden return(this.GenerationEnvironment.ToString()); }
/// <summary> /// Create the template output /// </summary> public override string TransformText() { this.Write("\r\n"); this.Write("import { Observable } from \'rxjs\';\r\nimport { fakeAsync, flushMicrotasks, TestBed " + "} from \'@angular/core/testing\';\r\nimport { DataServiceMock } from \'../../test-con" + "fig/mocks/dataServiceMock\';\r\nimport { DataService } from \'./data.service\';\r\nimpo" + "rt { "); #line 7 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(" } from \'./"); #line 7 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_api.Id))); #line default #line hidden this.Write(".service\';\r\n"); #line 8 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" if (_viewModels.AsEnumerable() != null) { foreach (string viewModel in _viewModels.AsEnumerable()) { #line default #line hidden this.Write("import { "); #line 14 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(viewModel))); #line default #line hidden this.Write(" } from \'../viewModels/"); #line 14 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(viewModel))); #line default #line hidden this.Write("\';\r\n"); #line 15 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } } #line default #line hidden this.Write("\r\ndescribe(\'"); #line 20 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(" service\', () => {\r\n let "); #line 21 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_api.Id))); #line default #line hidden this.Write("Spy: "); #line 21 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(";\r\n let spy: jasmine.Spy;\r\n\r\n beforeEach(() => {\r\n TestBed.configureTestingM" + "odule({\r\n providers: [\r\n "); #line 27 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(",\r\n { provide: DataService, useClass: DataServiceMock }\r\n ]\r\n });\r" + "\n "); #line 31 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_api.Id))); #line default #line hidden this.Write("Spy = TestBed.get("); #line 31 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(");\r\n });\r\n"); #line 33 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" if (_api != null && _api.Actions.AsEnumerable() != null) { foreach (ApiActionInfo action in _api.Actions.AsEnumerable()) { if (action.Id != null && action.Url != null && action.Type != null) { #line default #line hidden this.Write(" it(\'"); #line 41 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write(" service: should "); #line 41 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("\', fakeAsync(() => {\r\n const "); #line 42 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api = \'"); #line 42 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(action.Url)); #line default #line hidden this.Write("\';\r\n spy = spyOn("); #line 43 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_api.Id))); #line default #line hidden this.Write("Spy, \'"); #line 43 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("\').and.callThrough();\r\n "); #line 44 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_api.Id))); #line default #line hidden this.Write("Spy."); #line 44 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 45 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 58 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write("\r\n"); #line 59 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 64 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write(",\r\n"); #line 65 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } } } } #line default #line hidden this.Write(" );\r\n flushMicrotasks();\r\n expect(spy).toHaveBeenCalledWith(\r\n"); #line 74 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 87 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write("\r\n"); #line 88 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 93 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write(",\r\n"); #line 94 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } } } } #line default #line hidden this.Write(" );\r\n spy = spyOn("); #line 101 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_api.Id))); #line default #line hidden this.Write("Spy._dataService, \'"); #line 101 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(ConvertActionType(action.Type))); #line default #line hidden this.Write("\').and.callThrough();\r\n "); #line 102 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_api.Id))); #line default #line hidden this.Write("Spy."); #line 102 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 103 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 116 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write("\r\n"); #line 117 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 122 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write(",\r\n"); #line 123 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } } } } #line default #line hidden this.Write(" );\r\n flushMicrotasks();\r\n"); #line 131 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" switch (action.Type.ToLower()) { case "dataget": case "datalist": case "datadelete": #line default #line hidden this.Write(" expect(spy).toHaveBeenCalledWith(\r\n `${"); #line 137 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {\r\n"); #line 139 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 152 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": JSON.stringify("); #line 152 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write(")\r\n"); #line 153 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 158 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": JSON.stringify("); #line 158 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write("),\r\n"); #line 159 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } } } } #line default #line hidden this.Write(" }\r\n );\r\n"); #line 167 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" break; default: #line default #line hidden this.Write(" expect(spy).toHaveBeenCalledWith(\r\n `${"); #line 172 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("Api}`,\r\n {\r\n"); #line 174 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 187 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 187 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write("\r\n"); #line 188 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 193 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 193 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write(",\r\n"); #line 194 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } } } } #line default #line hidden this.Write(" },\r\n {}\r\n );\r\n"); #line 203 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" break; } #line default #line hidden this.Write(" var result = spy.calls.mostRecent().returnValue;\r\n expect(result instanceo" + "f Observable).toBeTruthy();\r\n }));\r\n\r\n"); #line 211 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ServiceSpecTemplate.tt" } } } #line default #line hidden this.Write("});\r\n"); return(this.GenerationEnvironment.ToString()); }
/// <summary> /// Create the template output /// </summary> public override string TransformText() { this.Write("\r\n"); this.Write("import { Observable } from \'rxjs\';\r\n"); #line 4 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" if (_viewModels.AsEnumerable() != null) { foreach (string viewModel in _viewModels.AsEnumerable()) { #line default #line hidden this.Write("import { "); #line 10 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(viewModel))); #line default #line hidden this.Write(" } from \'../../src/viewModels/"); #line 10 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(viewModel))); #line default #line hidden this.Write("\';\r\n"); #line 11 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" } } if (_api.Id != null) { #line default #line hidden this.Write("export class "); #line 18 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_api.Id))); #line default #line hidden this.Write("Mock {\r\n"); #line 19 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" if (_api.Actions.AsEnumerable() != null) { foreach (ApiActionInfo action in _api.Actions.AsEnumerable()) { if (action.Id != null && action.Url != null && action.Type != null) { #line default #line hidden this.Write(" public "); #line 27 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 28 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 40 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param: "); #line 40 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write("\r\n"); #line 41 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 46 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("Param: "); #line 46 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write(",\r\n"); #line 47 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" } } } } if (action.ReturnType != null && action.ReturnType.Id != null) { #line default #line hidden this.Write(" ): Observable<"); #line 56 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.ReturnType.Id))); #line default #line hidden this.Write("> {\r\n return Observable.of();\r\n }\r\n\r\n"); #line 60 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" } else { #line default #line hidden this.Write(" ): Observable<any> {\r\n return Observable.of();\r\n }\r\n\r\n"); #line 69 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" } } } } #line default #line hidden this.Write("}\r\n"); #line 76 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\MocksTemplate.tt" } #line default #line hidden return(this.GenerationEnvironment.ToString()); }
/// <summary> /// Create the template output /// </summary> public override string TransformText() { this.Write("\r\n"); this.Write(@"/* * You should add your licence here, here is an example : * * SonarQube, open source software quality management tool. * Copyright (C) 2008-2013 SonarSource * mailto:contact AT sonarsource DOT com * * SonarQube is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * SonarQube is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ "); #line 24 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_concernId != null && _layout != null && _layout.Id != null) { string layout = TextConverter.PascalCase(_concernId) + TextConverter.PascalCase(_layout.Id); string layoutToLower = TextConverter.CamelCase(_concernId) + "-" + TextConverter.CamelCase(_layout.Id); string layoutPathToLower = TextConverter.CamelCase(_concernId) + "/" + TextConverter.CamelCase(_layout.Id); #line default #line hidden this.Write("import { Component } from \'@angular/core\';\r\nimport { IonicPage, NavController"); #line 32 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_menu.AsEnumerable() != null && _menu.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(", Events"); #line 32 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } #line default #line hidden this.Write(" } from \'ionic-angular\';\r\n"); #line 33 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_viewModels.AsEnumerable() != null && _viewModels.AsEnumerable().Count() > 0) { foreach (string viewModel in _viewModels.AsEnumerable()) { #line default #line hidden this.Write("import { "); #line 39 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(viewModel))); #line default #line hidden this.Write(" } from \'../../../viewModels/"); #line 39 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(viewModel))); #line default #line hidden this.Write("\';\r\n"); #line 40 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } if (_apiDomainServices.AsEnumerable() != null && _apiDomainServices.AsEnumerable().Count() > 0) { #line default #line hidden this.Write("import { Observable } from \'rxjs\';\r\n"); #line 48 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" foreach (string service in _apiDomainServices.AsEnumerable()) { #line default #line hidden this.Write("import { "); #line 52 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(service))); #line default #line hidden this.Write(" } from \'../../../services/"); #line 52 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(service))); #line default #line hidden this.Write(".service\';\r\n"); #line 53 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } if (_languages.AsEnumerable() != null && _languages.AsEnumerable().Count() > 0) { #line default #line hidden this.Write("import { LanguagePage } from \'../../language/language\';\r\n"); #line 61 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } #line default #line hidden this.Write("\r\n/**\r\n * class: "); #line 66 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(".\r\n"); #line 67 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_layout.Description != null) { #line default #line hidden this.Write(" * "); #line 71 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(_layout.Description)); #line default #line hidden this.Write(".\r\n * This is the component of that layout.\r\n * This component is generated from " + "Concerns domain.\r\n"); #line 74 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } else { #line default #line hidden this.Write(" * You should add a description of your\r\n * layout\'s component here.\r\n * This is " + "the component of the current layout.\r\n * This component is generated from Concer" + "ns domain.\r\n"); #line 83 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } #line default #line hidden this.Write(" */\r\n@IonicPage({\r\n name: \'"); #line 88 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layoutToLower)); #line default #line hidden this.Write("\',\r\n segment: \'"); #line 89 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layoutPathToLower)); #line default #line hidden this.Write("\'\r\n})\r\n@Component({\r\n selector: \'"); #line 92 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layoutToLower)); #line default #line hidden this.Write("\',\r\n templateUrl: \'"); #line 93 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layoutToLower)); #line default #line hidden this.Write(".html\'\r\n})\r\nexport class "); #line 95 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(" {\r\n"); #line 96 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_menu.AsEnumerable() != null && _menu.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" public _menu;\r\n"); #line 101 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } #line default #line hidden this.Write(" constructor(\r\n"); #line 105 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_menu.AsEnumerable() != null && _menu.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" public _events: Events,\r\n"); #line 110 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } if (_apiDomainServices.AsEnumerable() != null && _apiDomainServices.AsEnumerable().Count() > 0) { foreach (string service in _apiDomainServices.AsEnumerable()) { #line default #line hidden this.Write(" public _"); #line 118 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(service))); #line default #line hidden this.Write(": "); #line 118 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(service))); #line default #line hidden this.Write(",\r\n"); #line 119 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } #line default #line hidden this.Write(" public _nav: NavController\r\n ) {\r\n"); #line 125 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_menu.AsEnumerable() != null && _menu.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" this._menu = [\r\n"); #line 130 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" string last = _menu.Keys.Last(); foreach (KeyValuePair <string, string> m in _menu.AsEnumerable()) { if (m.Key.Equals(last)) { #line default #line hidden this.Write(" { name: \'"); #line 137 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(m.Value)); #line default #line hidden this.Write("\', component: \'"); #line 137 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(m.Key)); #line default #line hidden this.Write("\' }\r\n"); #line 138 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } else { #line default #line hidden this.Write(" { name: \'"); #line 143 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(m.Value)); #line default #line hidden this.Write("\', component: \'"); #line 143 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(m.Key)); #line default #line hidden this.Write("\' },\r\n"); #line 144 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } #line default #line hidden this.Write(" ];\r\n"); #line 149 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } #line default #line hidden this.Write(" }\r\n\r\n"); #line 154 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (_layout.Actions.AsEnumerable() != null) { foreach (ActionInfo action in _layout.Actions.AsEnumerable()) { switch (action.Type.ToLower()) { case "navigation": if (action.Target != null) { string[] actionTargetSplitted = action.Target.Split('.'); string targetedConcern = TextConverter.CamelCase(actionTargetSplitted[0]); string targetedLayout = TextConverter.CamelCase(actionTargetSplitted[1]); #line default #line hidden this.Write(" /**\r\n * method: on"); #line 169 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("\r\n * That method is a navigation method.\r\n */\r\n public on"); #line 172 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("() {\r\n this._nav.push(\'"); #line 173 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(targetedConcern + "-" + targetedLayout)); #line default #line hidden this.Write("\');\r\n }\r\n\r\n"); #line 176 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } break; case "method": #line default #line hidden this.Write(" /**\r\n * method: on"); #line 182 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("\r\n * That method is a blank method.\r\n */\r\n public on"); #line 185 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("() {\r\n // TO DO\r\n }\r\n\r\n"); #line 189 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" break; case "dataget": case "datalist": case "datacreate": case "dataupdate": case "datadelete": if (action.Api != null && _api != null) { string[] actionSplitted = action.Api.Split('.'); string apiService = actionSplitted[0]; string apiAction = actionSplitted[1]; foreach (ApiInfo api in _api.AsEnumerable()) { if (api.Id.ToLower().Equals(apiService.ToLower()) && api.Actions.AsEnumerable() != null) { foreach (ApiActionInfo apiA in api.Actions.AsEnumerable()) { if (apiA.Id.ToLower().Equals(apiAction.ToLower())) { #line default #line hidden this.Write(" /**\r\n * method: on"); #line 208 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("\r\n * You should add a description of your method here.\r\n * that method is an " + "Api service call method.\r\n"); #line 211 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); #line default #line hidden this.Write(" * @param "); #line 220 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(" `"); #line 220 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write("`.\r\n"); #line 221 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } } #line default #line hidden this.Write(" * @returns A `Subscription<any>`.\r\n */\r\n public on"); #line 228 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 229 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 241 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 241 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write("\r\n"); #line 242 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 247 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(": "); #line 247 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(type)); #line default #line hidden this.Write(",\r\n"); #line 248 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } } } #line default #line hidden this.Write(" ) {\r\n return this._"); #line 255 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(api.Id))); #line default #line hidden this.Write("."); #line 255 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiA.Id))); #line default #line hidden this.Write("(\r\n"); #line 256 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null && apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 265 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 266 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } else if (apiParameter.Id != null) { #line default #line hidden this.Write(" "); #line 271 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 272 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } } #line default #line hidden this.Write(" ).subscribe();\r\n }\r\n\r\n"); #line 281 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } } } } } break; } } } if (_languages.AsEnumerable() != null && _languages.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" /**\r\n * method: onLanguage.\r\n * That method enables to enter language\r\n *" + " page with a button.\r\n */\r\n public onLanguage() {\r\n this._nav.push(Languag" + "ePage);\r\n }\r\n\r\n"); #line 304 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } if (_menu.AsEnumerable() != null && _menu.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" /**\r\n * method: ionViewWillEnter.\r\n * Base Ionic event which triggers\r\n *" + " global menu loading associated with\r\n * each layout\'s specific menu.\r\n */\r\n" + " public ionViewWillEnter() {\r\n this._events.publish(\'menu\', this._menu);\r\n " + "}\r\n"); #line 319 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } #line default #line hidden this.Write("}\r\n"); #line 323 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Layout\Templates\LayoutComponentTemplate.tt" } #line default #line hidden return(this.GenerationEnvironment.ToString()); }
/// <summary> /// Create the template output /// </summary> public override string TransformText() { this.Write("\r\n"); #line 2 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" var model = (SmartAppInfo)Model; #line default #line hidden this.Write("import RestApi from \'./RestApi\';\r\n\r\nexport default class "); #line 7 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(_api.Id)); #line default #line hidden this.Write("Api{\r\n\r\n"); #line 9 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" if (_api.Actions != null && _api.Actions.Count > 0) { foreach (ApiActionInfo action in _api.Actions) { if (action.Id != null && action.Url != null && action.Type != null) { #line default #line hidden this.Write(" "); #line 16 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 17 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = action.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 28 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 29 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 34 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 35 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } } } } #line default #line hidden this.Write(" ) {\r\n"); #line 43 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" switch (action.Type) { case "dataget": case "datalist": if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { #line default #line hidden this.Write(" let urlSearchParams = {};\r\n"); #line 52 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { #line default #line hidden this.Write(" urlSearchParams[\'"); #line 58 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\'] = JSON.stringify("); #line 58 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(");\r\n"); #line 59 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } } #line default #line hidden this.Write(" return RestApi.get(\'"); #line 63 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(action.Url)); #line default #line hidden this.Write("\', urlSearchParams) ;\r\n"); #line 64 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } else { #line default #line hidden this.Write(" return RestApi.get(\'"); #line 69 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(action.Url)); #line default #line hidden this.Write("\');\r\n"); #line 70 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } break; case "datacreate": #line default #line hidden this.Write(" let postData = {};\r\n"); #line 76 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { #line default #line hidden this.Write(" postData[\'"); #line 84 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\'] = "); #line 84 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(";\r\n"); #line 85 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" return RestApi.post(\'"); #line 90 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(action.Url)); #line default #line hidden this.Write("\', postData);\r\n"); #line 91 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" break; case "dataupdate": #line default #line hidden this.Write(" let putData = {};\r\n"); #line 96 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { #line default #line hidden this.Write(" putData[\'"); #line 104 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\'] = "); #line 104 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(";\r\n"); #line 105 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" return RestApi.put(\'"); #line 110 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(action.Url)); #line default #line hidden this.Write("\', putData);\r\n"); #line 111 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" break; case "datadelete": #line default #line hidden this.Write(" let urlSearchParams = {};\r\n"); #line 116 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" if (action.Parameters.AsEnumerable() != null && action.Parameters.AsEnumerable().Count() > 0) { foreach (ApiParameterInfo apiParameter in action.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { #line default #line hidden this.Write(" urlSearchParams[\'"); #line 124 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\'] = JSON.stringify("); #line 124 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(");\r\n"); #line 125 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write(" return RestApi.delete(\'"); #line 130 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(action.Url)); #line default #line hidden this.Write("\', urlSearchParams);\r\n"); #line 131 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" break; default: break; } #line default #line hidden this.Write(" }\r\n\r\n"); #line 138 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Apis\Templates\ApiTemplate.tt" } } } #line default #line hidden this.Write("}"); return(this.GenerationEnvironment.ToString()); }
/// <summary> /// Create the template output /// </summary> public override string TransformText() { this.Write("\r\nimport React from \'react\';\r\nimport { \r\n Image,\r\n Text,\r\n Button,\r\n View,\r\n " + " ScrollView\r\n} from \'react-native\';\r\n\r\n// Styles\r\nimport styles from \'../Styles/" + "StyleSheet\';\r\n\r\nexport default class "); #line 14 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_layout.Id))); #line default #line hidden this.Write("Screen extends React.Component {\r\n static navigationOptions = {\r\n title" + ":\'"); #line 16 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_layout.Title))); #line default #line hidden this.Write(" Screen\'\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n }\r\n"); #line 22 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" if (_layout.Actions.AsEnumerable() != null) { foreach (var action in _layout.Actions.AsEnumerable()) { switch (action.Type.ToLower()) { case "navigation": if (action.Target != null) { string[] actionTargetSplitted = action.Target.Split('.'); string targetedConcern = TextConverter.PascalCase(actionTargetSplitted[0]); string targetedLayout = TextConverter.PascalCase(actionTargetSplitted[1]); #line default #line hidden this.Write("\r\n "); #line 37 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write(" = () => {\r\n this.props.on"); #line 38 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("();\r\n }\r\n"); #line 40 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } break; case "method": #line default #line hidden this.Write("\r\n "); #line 46 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write(" = () => {\r\n //TODO\r\n }\r\n"); #line 49 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" break; case "dataget": case "datalist": case "datacreate": case "dataupdate": case "datadelete": if (action.Api != null && _api != null) { string[] actionSplitted = action.Api.Split('.'); string apiService = actionSplitted[0]; string apiAction = actionSplitted[1]; foreach (ApiInfo api in _api.AsEnumerable()) { if (api.Id.ToLower().Equals(apiService.ToLower()) && api.Actions.AsEnumerable() != null) { foreach (ApiActionInfo apiA in api.Actions.AsEnumerable()) { if (apiA.Id.ToLower().Equals(apiAction.ToLower())) { #line default #line hidden this.Write("\r\n "); #line 68 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write(" = (\r\n"); #line 69 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { // string type = apiParameter.TypeScriptType(); // type = IsModelBool(type) ? type + _viewModelSuffix : type; if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 82 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 83 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 88 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 89 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } } } } #line default #line hidden this.Write(" ) => {\r\n return this._"); #line 96 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(api.Id) + _apiSuffix)); #line default #line hidden this.Write("."); #line 96 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiA.Id))); #line default #line hidden this.Write("(\r\n"); #line 97 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null && apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 106 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 107 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 112 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 113 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } } } #line default #line hidden this.Write(" );\r\n }\r\n"); #line 120 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } } } } } break; } } } #line default #line hidden this.Write("\r\n render() {\r\n return (\r\n <View style={styles.container}>\r\n " + " <ScrollView>\r\n <View>\r\n"); #line 137 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" foreach (var action in _layout.Actions.AsEnumerable()) { if (action.Type.ToLower().Equals("navigation")) { #line default #line hidden this.Write(" <Button title=\""); #line 143 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(Helper.WordSeperator(TextConverter.PascalCase(action.Id)))); #line default #line hidden this.Write("\" onPress={this."); #line 143 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("}/>\r\n"); #line 144 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } } #line default #line hidden this.Write(" </View>\r\n <View>\r\n"); #line 150 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" foreach (var action in _layout.Actions.AsEnumerable()) { if (action.Type.ToLower().Equals("method")) { #line default #line hidden this.Write(" <Button title=\""); #line 156 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(Helper.WordSeperator(TextConverter.PascalCase(action.Id)))); #line default #line hidden this.Write("\" onPress={this."); #line 156 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id))); #line default #line hidden this.Write("}/>\r\n"); #line 157 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Views\Templates\ViewTemplate.tt" } } #line default #line hidden this.Write(" </View>\r\n </ScrollView>\r\n </View>\r\n " + " );\r\n }\r\n}"); return(this.GenerationEnvironment.ToString()); }
/// <summary> /// Create the template output /// </summary> public override string TransformText() { this.Write("\r\n"); #line 3 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (_smartAppId != null && _concernId != null && _layout != null && _layout.Id != null) { string smartAppId = TextConverter.PascalCase(_smartAppId); string layout = TextConverter.PascalCase(_concernId) + TextConverter.PascalCase(_layout.Id); string layoutToLower = TextConverter.CamelCase(_concernId) + "-" + TextConverter.CamelCase(_layout.Id); #line default #line hidden this.Write(@"import { IonicModule, NavController, Platform } from 'ionic-angular'; import { NavMock } from '../../../../test-config/mocks/navMock'; import { PlatformMock } from '../../../../test-config/mocks/platformMock'; import { SplashScreen } from '@ionic-native/splash-screen'; import { SplashScreenMock } from '../../../../test-config/mocks/splashScreenMock'; import { StatusBar } from '@ionic-native/status-bar'; import { StatusBarMock } from '../../../../test-config/mocks/statusBarMock'; import { Title } from '@angular/platform-browser'; import { TitleMock } from '../../../../test-config/mocks/titleMock'; import { async, ComponentFixture, fakeAsync, flushMicrotasks, TestBed } from '@angular/core/testing'; "); #line 20 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" bool isLanguages = false; if (_languages.AsEnumerable() != null && _languages.AsEnumerable().Count() > 0) { isLanguages = true; } if (isLanguages) { #line default #line hidden this.Write(@"import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { TranslateServiceMock } from '../../../../test-config/mocks/translateServiceMock'; import { LanguagePageModule } from '../../language/language.module'; import { LanguagePage } from '../../language/language'; "); #line 34 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } #line default #line hidden this.Write("import { "); #line 37 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(smartAppId)); #line default #line hidden this.Write(" } from \'../../../app/app.component\';\r\nimport { "); #line 38 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(" } from \"./"); #line 38 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layoutToLower)); #line default #line hidden this.Write("\";\r\n"); #line 39 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (_viewModels.AsEnumerable() != null && _viewModels.AsEnumerable().Count() > 0) { foreach (string viewModel in _viewModels.AsEnumerable()) { #line default #line hidden this.Write("import { "); #line 45 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(viewModel))); #line default #line hidden this.Write(" } from \'../../../viewModels/"); #line 45 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(viewModel))); #line default #line hidden this.Write("\';\r\n"); #line 46 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } if (_apiDomainServices.AsEnumerable() != null && _apiDomainServices.AsEnumerable().Count() > 0) { foreach (string service in _apiDomainServices.AsEnumerable()) { #line default #line hidden this.Write("import { "); #line 55 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(service))); #line default #line hidden this.Write(" } from \'../../../services/"); #line 55 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(service))); #line default #line hidden this.Write(".service\';\r\nimport { "); #line 56 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(service))); #line default #line hidden this.Write("Mock } from \'../../../../test-config/mocks/"); #line 56 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(service))); #line default #line hidden this.Write("Mock\';\r\n"); #line 57 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } #line default #line hidden this.Write("describe(\'"); #line 61 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(" Component\', () => {\r\n let fixture: ComponentFixture<"); #line 62 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(">;\r\n let component: "); #line 63 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(";\r\n let spy: jasmine.Spy;\r\n\r\n beforeEach(async(() => {\r\n TestBed.configureTe" + "stingModule({\r\n declarations: [\r\n "); #line 69 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(smartAppId)); #line default #line hidden this.Write(",\r\n "); #line 70 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write("\r\n ],\r\n imports: [\r\n"); #line 73 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (isLanguages) { #line default #line hidden this.Write(" LanguagePageModule,\r\n TranslateModule.forChild(),\r\n"); #line 79 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } #line default #line hidden this.Write(" IonicModule.forRoot("); #line 82 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(smartAppId)); #line default #line hidden this.Write(")\r\n ],\r\n providers: [\r\n"); #line 85 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (_apiDomainServices.AsEnumerable() != null && _apiDomainServices.AsEnumerable().Count() > 0) { foreach (string service in _apiDomainServices.AsEnumerable()) { #line default #line hidden this.Write(" { provide: "); #line 91 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(service))); #line default #line hidden this.Write(", useClass: "); #line 91 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(service))); #line default #line hidden this.Write("Mock },\r\n"); #line 92 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } #line default #line hidden this.Write(" { provide: Platform, useClass: PlatformMock },\r\n { provide: Status" + "Bar, useClass: StatusBarMock },\r\n { provide: SplashScreen, useClass: Spla" + "shScreenMock },\r\n"); #line 99 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (isLanguages) { #line default #line hidden this.Write(" { provide: TranslateService, useClass: TranslateServiceMock },\r\n"); #line 104 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } #line default #line hidden this.Write(" { provide: NavController, useClass: NavMock },\r\n { provide: Title," + " useClass: TitleMock },\r\n ]\r\n }).compileComponents();\r\n }));\r\n\r\n befor" + "eEach(async() => {\r\n fixture = TestBed.createComponent("); #line 114 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(");\r\n component = fixture.componentInstance;\r\n });\r\n \r\n afterEach(() => {\r\n " + " fixture.destroy();\r\n component = null;\r\n });\r\n\r\n it(\'"); #line 123 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(" Component: should be created\', fakeAsync(() => {\r\n expect(component instanceo" + "f "); #line 124 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(").toBeTruthy();\r\n }));\r\n\r\n"); #line 127 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (isLanguages) { #line default #line hidden this.Write(" it(\'"); #line 131 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(@" Component: should navigate to language page', fakeAsync(() => { spy = spyOn(component, 'onLanguage').and.callThrough(); component.onLanguage(); flushMicrotasks(); expect(spy).toHaveBeenCalled(); spy = spyOn(component._nav, 'push').and.callThrough(); component.onLanguage(); flushMicrotasks(); expect(spy).toHaveBeenCalledWith(LanguagePage); spy.calls.mostRecent().returnValue.then((result) => { expect(result).toEqual('PUSH'); }); })); "); #line 144 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } if (_layout.Actions.AsEnumerable() != null) { foreach (ActionInfo action in _layout.Actions.AsEnumerable()) { switch (action.Type.ToLower()) { case "navigation": if (action.Target != null) { string[] actionTargetSplitted = action.Target.Split('.'); string targetedConcern = TextConverter.CamelCase(actionTargetSplitted[0]); string targetedLayout = TextConverter.CamelCase(actionTargetSplitted[1]); #line default #line hidden this.Write(" it(\'"); #line 160 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(" Component - on"); #line 160 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write(": should navigate to "); #line 160 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(targetedConcern + "-" + targetedLayout)); #line default #line hidden this.Write(" page\', fakeAsync(() => {\r\n spy = spyOn(component, \'on"); #line 161 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("\').and.callThrough();\r\n component.on"); #line 162 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("();\r\n flushMicrotasks();\r\n expect(spy).toHaveBeenCalled();\r\n spy = spyOn" + "(component._nav, \'push\').and.callThrough();\r\n component.on"); #line 166 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("();\r\n flushMicrotasks();\r\n expect(spy).toHaveBeenCalledWith(\'"); #line 168 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(targetedConcern + "-" + targetedLayout)); #line default #line hidden this.Write("\');\r\n spy.calls.mostRecent().returnValue.then((result) => {\r\n expect(resu" + "lt).toEqual(\'PUSH\');\r\n });\r\n }));\r\n\r\n"); #line 174 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } break; case "method": #line default #line hidden this.Write(" it(\'"); #line 179 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(" Component - on"); #line 179 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write(": should do nothing\', fakeAsync(() => {\r\n spy = spyOn(component, \'on"); #line 180 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("\').and.callThrough();\r\n component.on"); #line 181 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("();\r\n flushMicrotasks();\r\n expect(spy).toHaveBeenCalled();\r\n var result " + "= spy.calls.mostRecent().returnValue;\r\n expect(result).toBeUndefined();\r\n })" + ");\r\n\r\n"); #line 188 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" break; case "dataget": case "datalist": case "datacreate": case "dataupdate": case "datadelete": if (action.Api != null && _api != null) { string[] actionSplitted = action.Api.Split('.'); string apiService = actionSplitted[0]; string apiAction = actionSplitted[1]; foreach (ApiInfo api in _api.AsEnumerable()) { if (api.Id.ToLower().Equals(apiService.ToLower()) && api.Actions.AsEnumerable() != null) { foreach (ApiActionInfo apiA in api.Actions.AsEnumerable()) { if (apiA.Id.ToLower().Equals(apiAction.ToLower())) { #line default #line hidden this.Write(" it(\'"); #line 206 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(layout)); #line default #line hidden this.Write(" Component - on"); #line 206 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write(": should use "); #line 206 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(api.Id))); #line default #line hidden this.Write(" service to "); #line 206 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("\', fakeAsync(() => {\r\n"); #line 207 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); #line default #line hidden this.Write(" var "); #line 217 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(" = "); #line 217 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(value)); #line default #line hidden this.Write(";\r\n"); #line 218 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } } #line default #line hidden this.Write(" spy = spyOn(component, \'on"); #line 223 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("\').and.callThrough();\r\n component.on"); #line 224 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 225 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 238 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 239 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 244 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 245 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } } } #line default #line hidden this.Write(" );\r\n flushMicrotasks();\r\n expect(spy).toHaveBeenCalledWith(\r\n"); #line 254 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 267 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 268 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 273 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 274 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } } } #line default #line hidden this.Write(" );\r\n spy = spyOn(component._"); #line 281 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(api.Id))); #line default #line hidden this.Write(", \'"); #line 281 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiA.Id))); #line default #line hidden this.Write("\').and.callThrough();\r\n component.on"); #line 282 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(action.Id))); #line default #line hidden this.Write("(\r\n"); #line 283 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 296 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 297 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 302 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 303 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } } } #line default #line hidden this.Write(" );\r\n flushMicrotasks();\r\n expect(spy).toHaveBeenCalledWith(\r\n"); #line 312 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" if (apiA.Parameters.AsEnumerable() != null && apiA.Parameters.AsEnumerable().Count() > 0) { ApiParameterInfo last = apiA.Parameters.AsEnumerable().Last(); foreach (ApiParameterInfo apiParameter in apiA.Parameters.AsEnumerable()) { if (apiParameter.Id != null) { string type = apiParameter.TypeScriptType(); string value = getValueFromType(type); if (apiParameter.Equals(last)) { #line default #line hidden this.Write(" "); #line 325 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write("\r\n"); #line 326 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } else { #line default #line hidden this.Write(" "); #line 331 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(apiParameter.Id))); #line default #line hidden this.Write(",\r\n"); #line 332 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } } } #line default #line hidden this.Write(" );\r\n var result = spy.calls.mostRecent().returnValue;\r\n expect(result)." + "toBeDefined();\r\n }));\r\n"); #line 342 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } } } } } break; } } } #line default #line hidden this.Write("});\r\n"); #line 354 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\UnitTests\Templates\ComponentSpecTemplate.tt" } #line default #line hidden return(this.GenerationEnvironment.ToString()); }