public void Importer_Should_Import_Metrics() { //arrange var fixture = new Fixture(); string expectedBuildName = fixture.Create("BuildName"); var dataToImport = CreateTestDataToImport(fixture); var fakeMetricsStore = new InMemoryMetricsStore(); var importer = new XmlImporter(fakeMetricsStore); //act Task importTask = importer.Import(dataToImport, expectedBuildName); importTask.Wait(); //assert VerifyBuild(dataToImport, fakeMetricsStore, expectedBuildName); }
static void Main(string[] args) { if (args == null || !args.Any()) args = new[] { "Sample.xml" }; //args = new[] { "..\\..\\WebjetPlanIt_Master_Metrics_CI_20130418.4-Metrics.xml" }; var metricsXmlData = XBuild.Load(args[0]); string buildName = Path.GetFileNameWithoutExtension(args[0]); var importer = new XmlImporter(new MetricsDbContext()); Task importTask = importer.Import(metricsXmlData, buildName); importTask.Wait(); #if DEBUG Console.WriteLine("Done importing. Press [Enter] to close."); Console.ReadLine(); #endif }