コード例 #1
0
        private static async Task LoadXsdFiles(BulkLoadClientConfiguration bulkLoadClientConfiguration,
                                               OdsVersionInformation odsVersionInformation)
        {
            using var xsdFilesRetriever = new XsdFilesRetriever(
                      bulkLoadClientConfiguration,
                      new XsdMetadataInformationProvider(),
                      new XsdMetadataFilesProvider(),
                      new RemoteFileDownloader(),
                      odsVersionInformation);

            await xsdFilesRetriever.DownloadXsdFilesAsync();
        }
コード例 #2
0
        public async Task Should_get_xsd_metadata_information_and_download_files()
        {
            var odsVersionInformation = new OdsVersionInformation
            {
                DataModels = new List <Dictionary <string, string> >
                {
                    new Dictionary <string, string>
                    {
                        { "name", "Ed-Fi" },
                        { "version", "3.3.1-b" }
                    },
                    new Dictionary <string, string>
                    {
                        { "name", "TPDM" },
                        { "version", "1.1.0" }
                    }
                }
            };

            using var sut = new XsdFilesRetriever(
                      _configuration,
                      new XsdMetadataInformationProvider(),
                      new XsdMetadataFilesProvider(),
                      new RemoteFileDownloader(),
                      odsVersionInformation);

            sut.ShouldNotBeNull();

            await sut.DownloadXsdFilesAsync();

            Directory.Exists(_xsdFolder).ShouldBeTrue();

            string[] files = Directory.GetFiles(_xsdFolder);
            files.Length.ShouldNotBe(0);

            foreach (var file in files)
            {
                var fileInfo = new FileInfo(file);

                fileInfo.Exists.ShouldBe(true);

                // validate we actually wrote the contents of the file
                fileInfo.Length.ShouldBeGreaterThan(0);
            }
        }