<commit_before>﻿// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.IO;
using System.Linq;
using Microsoft.Build.Evaluation;
using Xunit;

namespace Microsoft.Build.Graph.UnitTests
{
    public class ProjectGraphTests
    {
        [Fact]
        public void TestGraphWithSingleNode()
        {
            string projectContents = @"
                <Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
                  <PropertyGroup>
                    <TestProperty>value</TestProperty>
                  </PropertyGroup>

                  <Target Name='Build'>
                    <Message Text='Building test project'/>
                  </Target>
                </Project>
                ";
            string testDirectory = Path.GetTempPath();
            string projectPath = Path.Combine(testDirectory, "ProjectGraphTest.proj");
            File.WriteAllText(projectPath, projectContents);
            var projectGraph = new ProjectGraph(projectPath);
            
            Assert.Equal(1, projectGraph.ProjectNodes.Count);
            Project projectNode = projectGraph.ProjectNodes.First().Project;
            Assert.Equal(projectPath, projectNode.FullPath);
        }
    }

}<commit_msg>Address feedback<commit_after>﻿// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.IO;
using System.Linq;
using Microsoft.Build.Evaluation;
using Microsoft.Build.UnitTests;
using Xunit;
using Shouldly;

namespace Microsoft.Build.Graph.UnitTests
{
    public class ProjectgraphTests
    {
        [Fact]
        public void TestGraphWithSingleNode()
        {
            string projectContents = @"
                <Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
                  <PropertyGroup>
                    <TestProperty>value</TestProperty>
                  </PropertyGroup>

                  <Target Name='Build'>
                    <Message Text='Building test project'/>
                  </Target>
                </Project>
                ";
            using (var env = TestEnvironment.Create())
            {
                TransientTestProjectWithFiles testProject =
                    env.CreateTestProjectWithFiles(projectContents, Array.Empty<string>());
                var projectGraph = new ProjectGraph(testProject.ProjectFile);
                projectGraph.ProjectNodes.Count.ShouldBe(1);
                Project projectNode = projectGraph.ProjectNodes.First().Project;
                projectNode.FullPath.ShouldBe(testProject.ProjectFile);
            }
        }
    }

}
{'fraction_non_alphanumeric': 0.08964781216648879, 'fraction_numerical': 0.0035574528637495554, 'mean_word_length': 1.994675186368477, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1554309', 'n_tokens_mistral': 691, 'n_tokens_neox': 640, 'n_words': 156}