Example #1
0
        private void CreateRepository()
        {
            var userInfos = UserInfoGenerator.Generate(0, 0);
            var dataSet   = new CremaDataSet();

            try
            {
                CremaBootstrapper.CreateRepositoryInternal(this.application, this.Path, this.RepositoryModule, this.FileType, this.DataBaseUrl, userInfos, dataSet);
            }
            catch
            {
                if (this.Force == true)
                {
                    DirectoryUtility.Delete(this.Path);
                }
                CremaBootstrapper.CreateRepositoryInternal(this.application, this.Path, this.RepositoryModule, this.FileType, this.DataBaseUrl, userInfos, dataSet);
            }
        }
Example #2
0
        public async Task InitializeAsync(TestContext context)
        {
            var basePath       = Path.Combine(context.TestRunDirectory, "repo");
            var repositoryPath = GenerateRepositoryPath();
            var userInfos      = UserInfoGenerator.Generate(0, 0);
            var dataSet        = new CremaDataSet();
            await Task.Run(() => CremaBootstrapper.CreateRepositoryInternal(this, repositoryPath, "git", "xml", string.Empty, userInfos, dataSet));

            this.BasePath  = repositoryPath;
            this.LongPaths = Environment.OSVersion.Platform == PlatformID.Win32NT;
            this.cremaHost = this.GetService(typeof(ICremaHost)) as ICremaHost;
            this.context   = context;

            string GenerateRepositoryPath()
            {
                var repositoryPath = Path.Combine(basePath, context.FullyQualifiedTestClassName);

                if (Environment.OSVersion.Platform == PlatformID.Win32NT && repositoryPath.Length > 168)
                {
                    repositoryPath = Path.Combine(basePath, $"{Guid.NewGuid()}");
                }
                return(repositoryPath);
            }
        }