Example #1
0
        public async Task SolutionFolderTags()
        {
            string   solFile = Util.GetSampleProject("console-project", "ConsoleProject.sln");
            Solution sol     = (Solution)await Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solFile);

            var model = sol.RootFolder.GetStringTagModel(ConfigurationSelector.Default);

            Assert.AreEqual(sol.FileName, model.GetValue("SolutionFile"));
            Assert.AreEqual("ConsoleProject", model.GetValue("SolutionName"));
            Assert.AreEqual(sol.ItemDirectory, model.GetValue("SolutionDir"));

            var mdesc = sol.GetStringTagModelDescription(ConfigurationSelector.Default);
            var tt    = mdesc.GetTags().Select(t => t.Name).ToArray();

            Assert.That(tt.Contains("SolutionFile"));
            Assert.That(tt.Contains("SolutionName"));
            Assert.That(tt.Contains("SolutionDir"));

            sol.Dispose();
        }
Example #2
0
        public async Task SolutionTags()
        {
            string   solFile = Util.GetSampleProject("console-project", "ConsoleProject.sln");
            Solution sol     = (Solution)await Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solFile);

            var p = (DotNetProject)sol.Items [0];

            sol.LocalAuthorInformation = new AuthorInformation("test name", "test email", "test copy", "test company", "test trademark");

            var model = sol.GetStringTagModel(ConfigurationSelector.Default);

            Assert.AreEqual(sol.FileName, model.GetValue("SolutionFile"));
            Assert.AreEqual("ConsoleProject", model.GetValue("SolutionName"));
            Assert.AreEqual(sol.ItemDirectory, model.GetValue("SolutionDir"));

            var mdesc = sol.GetStringTagModelDescription(ConfigurationSelector.Default);
            var tt    = mdesc.GetTags().Select(t => t.Name).ToArray();

            Assert.That(tt.Contains("SolutionFile"));
            Assert.That(tt.Contains("SolutionName"));
            Assert.That(tt.Contains("SolutionDir"));
        }