//[Fact]
        public void DownloadNonExistentComponentFromExchange()
        {
            string metaDirectory       = META.VersionInfo.MetaPath;
            var    componentToDownload = new ISIS.VehicleForge.VFComponent();

            // Might make sense to randomly generate a component id and try it - 24 hex characters
            componentToDownload.zip_url = "/rest/exchange/components/aaaabbbbccccddddeeeeffff/zip";

            using (VFWebClient vfWebClient = new VFWebClient(this.fixture.credentials.Url, this.fixture.credentials))
            {
                VFExchange exchange = new VFExchange(vfWebClient);

                string newZipPath = exchange.DownloadComponent(componentToDownload, metaDirectory);

                Assert.Null(newZipPath);
            }
        }
        //[Fact]
        public void DownloadComponentFromExchange()
        {
            string metaDirectory       = META.VersionInfo.MetaPath;
            var    componentToDownload = new ISIS.VehicleForge.VFComponent();

            // https://testbench.vf.isis.vanderbilt.edu/rest/exchange/components/5282583bc51df0577fa0fd23
            // Engine_Caterpillar_C9_280kW

            componentToDownload.zip_url = "/rest/exchange/components/5282583bc51df0577fa0fd23/zip";

            using (VFWebClient vfWebClient = new VFWebClient(this.fixture.credentials.Url, this.fixture.credentials))
            {
                VFExchange exchange = new VFExchange(vfWebClient);

                string newZipPath = exchange.DownloadComponent(componentToDownload, metaDirectory);

                Assert.NotNull(newZipPath);

                if (File.Exists(newZipPath))
                {
                    File.Delete(newZipPath);
                }
            }
        }
Esempio n. 3
0
        public VFComponentListItem(VFComponent component)
        {
            Contract.Requires(component != null);

            Component = component;
        }