/// <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(); }