private static void VerifyBuild(
            XBuild expectedBuild,
            InMemoryMetricsStore fakeMetricsStore,
            string expectedBuildName)
        {
            var actualBuilds = fakeMetricsStore.Builds;
            actualBuilds.Should().NotBeNull().And.HaveCount(1);
            actualBuilds.Should().OnlyContain(aBuild => aBuild.Name.Equals(expectedBuildName) &&
                                                        aBuild.Metrics.IsNotNullOrEmpty());

            Build actualBuild = actualBuilds.First();
            actualBuild.Should().NotBeNull();

            VerifyTargets(expectedBuild, actualBuild);
        }
        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);
        }