Exemplo n.º 1
0
        public void ModifyNameAndVersion()
        {
            var importPipeline = ImportPipeline.Create().Build();

            var createExplorer = ProjectExplorer.CreateProject(FileName("project"), importPipeline);

            createExplorer.Definition.Properties.Name    = "TestName1";
            createExplorer.Definition.Properties.Version = "1.0.0";

            createExplorer.Definition.SaveChanges();

            var loadExplorer = ProjectExplorer.Load(FileName("project"), importPipeline);

            Assert.That(loadExplorer.Definition.Properties.Name, Is.EqualTo("TestName1"));
            Assert.That(loadExplorer.Definition.Properties.Version, Is.EqualTo("1.0.0"));

            loadExplorer.ExportZippedToDirectory(new BuildPipeline()
            {
                ImportPipeline = importPipeline,
            }, FileName("export"));

            var packageImport = PackageExplorer.LoadFromFileAsync(
                Path.Combine(FileName("export"), "TestName1.bpkg")).Result;

            Assert.That(packageImport.Definition.Properties.Name, Is.EqualTo("TestName1"));
            Assert.That(packageImport.Definition.Properties.Version, Is.EqualTo("1.0.0"));
        }
Exemplo n.º 2
0
        public void ModifyNameAndVersion()
        {
            var createExplorer = ProjectExplorer.CreateProject(FileName("project"), new ImportPipeline());

            createExplorer.Definition.Properties.Name    = "TestName1";
            createExplorer.Definition.Properties.Version = "1.0.0";

            createExplorer.Definition.SaveChanges();

            var loadExplorer = ProjectExplorer.Load(FileName("project"), new ImportPipeline());

            Assert.That(loadExplorer.Definition.Properties.Name, Is.EqualTo("TestName1"));
            Assert.That(loadExplorer.Definition.Properties.Version, Is.EqualTo("1.0.0"));

            loadExplorer.Export(new BuildPipeline()
            {
                ImportPipeline = new ImportPipeline(),
            }, FileName("export"));

            var packageImport = PackageExplorer.Load(
                Path.Combine(FileName("export"), "TestName1.bpkg"));

            Assert.That(packageImport.Definition.Properties.Name, Is.EqualTo("TestName1"));
            Assert.That(packageImport.Definition.Properties.Version, Is.EqualTo("1.0.0"));
        }
Exemplo n.º 3
0
        public void ModifyVersion()
        {
            var    importPipeline = ImportPipeline.Create().Build();
            string projectPath    = TestUtilities.CreateFilePath("project");
            string exportPath     = Path.Combine(TestUtilities.CreateFilePath("export"), "project.bpkg");

            using (var explorer = ProjectExplorer.CreateProject(projectPath, importPipeline))
            {
                explorer.Definition.Properties.Version = "1.0.0";
                explorer.Definition.SaveChanges();
            }

            using (var explorer = ProjectExplorer.Load(projectPath, importPipeline))
            {
                Assert.That(explorer.Definition.Properties.Version, Is.EqualTo("1.0.0"));

                explorer.ExportZippedToDirectory(new BuildPipeline()
                {
                    ImportPipeline = importPipeline,
                }, TestUtilities.CreateFilePath("export"));
            }

            using (var explorer = PackageExplorer.LoadFromFileAsync(exportPath).Result)
            {
                Assert.That(explorer.Definition.Properties.Version, Is.EqualTo("1.0.0"));
            }
        }
Exemplo n.º 4
0
        public void CreateBlankProject()
        {
            var    importPipeline = ImportPipeline.Create().Build();
            string projectPath    = TestUtilities.CreateFilePath("project");

            using (var explorer = ProjectExplorer.CreateProject(projectPath, importPipeline))
            {
                explorer.Definition.Properties.Name = "TestName1";
                explorer.Definition.SaveChanges();
            }
        }