Exemplo n.º 1
0
        /// <summary>
        /// Save Northwind DTO metadata to a script file
        /// Certain tests will load this script dynamically so they can get metadata
        /// without making a Web API call
        /// </summary>
        public static void WriteNorthwindDtoMetadataScriptFile()
        {
            var metadata = new NorthwindDtoRepository().Metadata;
            var scriptFilename = HostingEnvironment.MapPath("~/tests/helpers/northwindDtoMetadata.js");
            const string prefix = "docCode.northwindDtoMetadata = ";
            const string postfix = ";";

            using (var writer = new StreamWriter(scriptFilename))
            {
                writer.WriteLine(prefix + metadata + postfix);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Save Northwind DTO metadata to a script file
        /// Certain tests will load this script dynamically so they can get metadata
        /// without making a Web API call
        /// </summary>
        public static void WriteNorthwindDtoMetadataScriptFile()
        {
            var          metadata       = new NorthwindDtoRepository().Metadata;
            var          scriptFilename = HostingEnvironment.MapPath("~/tests/helpers/northwindDtoMetadata.js");
            const string prefix         = "docCode.northwindDtoMetadata = ";
            const string postfix        = ";";

            using (var writer = new StreamWriter(scriptFilename))
            {
                writer.WriteLine(prefix + metadata + postfix);
            }
        }
 // Todo: inject via an interface rather than "new" the concrete class
 public NorthwindDtoController(NorthwindDtoRepository repository)
 {
     _repository = repository ?? new NorthwindDtoRepository();
 }
Exemplo n.º 4
0
 // Todo: inject via an interface rather than "new" the concrete class
 public NorthwindDtoController(NorthwindDtoRepository repository)
 {
     _repository = repository ?? new NorthwindDtoRepository();
 }