public async Task SetProjectGuidAsync_WhenNoProjectGuidProperty_DoesNotSet(string projectXml) { var result = ProjectRootElementFactory.Create(projectXml); var provider = CreateInstance(result); await provider.SetProjectGuidAsync(new Guid("{C26D43ED-ED18-46F9-8950-0B1A7232746E}")); MSBuildAssert.AssertProjectXml(projectXml, result); }
public async Task SetProjectGuidAsync_SetsFirstProjectGuidIgnoringConditions(string input, string expected) { var result = ProjectRootElementFactory.Create(input); var provider = CreateInstance(result); await provider.SetProjectGuidAsync(new Guid("{C26D43ED-ED18-46F9-8950-0B1A7232746E}")); MSBuildAssert.AssertProjectXml(expected, result); }
[InlineData("C26D43EDED1846F989500B1%417232746E")] // With escaped characters public async Task SetProjectGuidAsync_WhenProjectGuidPropertyAlreadyHasSameGuid_DoesNotSet(string guid) { var projectXml = $@" <Project> <PropertyGroup> <ProjectGuid>{guid}</ProjectGuid> </PropertyGroup> </Project>"; var result = ProjectRootElementFactory.Create(projectXml); var provider = CreateInstance(result); await provider.SetProjectGuidAsync(new Guid("{C26D43ED-ED18-46F9-8950-0B1A7232746E}")); MSBuildAssert.AssertProjectXml(projectXml, result); }