public async void ConfigurationProjectConfigurationDimensionProvider_GetProjectConfigurationDimensionsAsync_NoPropertyValue() { using (var projectFile = new MsBuildProjectFile()) { IProjectXmlAccessor _projectXmlAccessor = IProjectXmlAccessorFactory.Create(projectFile.Project); var provider = new ConfigurationProjectConfigurationDimensionProvider(_projectXmlAccessor); var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: projectFile.Filename); var values = await provider.GetProjectConfigurationDimensionsAsync(unconfiguredProject); Assert.Equal(0, values.Count()); } }
public async void ConfigurationProjectConfigurationDimensionProvider_GetProjectConfigurationDimensionsAsync() { using (var projectFile = new MsBuildProjectFile(projectXml)) { IProjectXmlAccessor _projectXmlAccessor = IProjectXmlAccessorFactory.Create(projectFile.Project); var provider = new ConfigurationProjectConfigurationDimensionProvider(_projectXmlAccessor); var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: projectFile.Filename); var values = await provider.GetProjectConfigurationDimensionsAsync(unconfiguredProject); Assert.Equal(1, values.Count()); var value = values.First(); Assert.Equal(ConfigurationGeneral.ConfigurationProperty, value.Key); string[] dimensionValues = value.Value.ToArray(); Assert.Equal(3, dimensionValues.Length); Assert.Equal("Debug", dimensionValues[0]); Assert.Equal("Release", dimensionValues[1]); Assert.Equal("CustomConfiguration", dimensionValues[2]); } }