Пример #1
0
        /***************************************************/
        /**** Constructors                              ****/
        /***************************************************/

        //Add any applicable constructors here, such as linking to a specific file or anything else as well as linking to that file through the (if existing) com link via the API
        public RepoAdapter(string teamspace, string modelId, string apiKey, string url = "https://api1.www.3drepo.io/api")
        {
            Logger.Instance.Log("Establishing repo controller with URL: " + url + " api key: " + apiKey + " teamspace: " + teamspace + "modelID: " + modelId);
            controller = new RepoController(url, apiKey, teamspace, modelId);

            AdapterId = BH.Engine._3DRepo_Toolkit.Convert.AdapterId;   //Set the "AdapterId" to "SoftwareName_id". Generally stored as a constant string in the convert class in the SoftwareName_Engine

            Config.SeparateProperties = true;   //Set to true to push dependant properties of objects before the main objects are being pushed. Example: push nodes before pushing bars
            Config.MergeWithComparer = true;    //Set to true to use EqualityComparers to merge objects. Example: merge nodes in the same location
            Config.ProcessInMemory = false;     //Set to false to to update objects in the toolkit during the push
            Config.CloneBeforePush = true;      //Set to true to clone the objects before they are being pushed through the software. Required if any modifications at all, as adding a software ID is done to the objects
            Config.UseAdapterId = true;         //Tag objects with a software specific id in the CustomData. Requires the NextIndex method to be overridden and implemented
        }
Пример #2
0
        public void GitHubRepoInfoTest()
        {
            var searchUser     = "******";
            var repoController = new RepoController();

            //Act
            ActionResult result = repoController.GitHubRepoInfo(searchUser);

            //Assert
            Assert.IsInstanceOfType(result, typeof(PartialViewResult));

            //Verify the result model type
            ViewResult vResult = result as ViewResult;

            if (vResult != null)
            {
                Assert.IsInstanceOfType(vResult.Model, typeof(DataModels.Repo));
            }
        }