public async Task GetProjectConfigurationDimensionsAsync_TFM() { var projectAccessor = IProjectAccessorFactory.Create(ProjectXmlTFM); var provider = new TargetFrameworkProjectConfigurationDimensionProvider(projectAccessor); var project = UnconfiguredProjectFactory.Create(); var values = await provider.GetProjectConfigurationDimensionsAsync(project); Assert.Empty(values); }
public async Task TargetFrameworkProjectConfigurationDimensionProvider_GetProjectConfigurationDimensionsAsync_TFM() { using (var projectFile = new MsBuildProjectFile(ProjectXmlTFM)) { IProjectXmlAccessor _projectXmlAccessor = IProjectXmlAccessorFactory.Create(projectFile.Project); var provider = new TargetFrameworkProjectConfigurationDimensionProvider(_projectXmlAccessor); var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: projectFile.Filename); var values = await provider.GetProjectConfigurationDimensionsAsync(unconfiguredProject); Assert.Equal(0, values.Count()); } }
public async Task GetProjectConfigurationDimensionsAsync_TFMs(string projectXml) { var projectAccessor = IProjectAccessorFactory.Create(projectXml); var provider = new TargetFrameworkProjectConfigurationDimensionProvider(projectAccessor); var project = UnconfiguredProjectFactory.Create(); var values = await provider.GetProjectConfigurationDimensionsAsync(project); Assert.Single(values); var value = values.First(); Assert.Equal(ConfigurationGeneral.TargetFrameworkProperty, value.Key); string[] dimensionValues = value.Value.ToArray(); AssertEx.CollectionLength(dimensionValues, 2); Assert.Equal("netcoreapp1.0", dimensionValues[0]); Assert.Equal("net45", dimensionValues[1]); }
public async Task TargetFrameworkProjectConfigurationDimensionProvider_GetProjectConfigurationDimensionsAsync_TFMs(string projectXml) { using (var projectFile = new MsBuildProjectFile(projectXml)) { IProjectXmlAccessor _projectXmlAccessor = IProjectXmlAccessorFactory.Create(projectFile.Project); var provider = new TargetFrameworkProjectConfigurationDimensionProvider(_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.TargetFrameworkProperty, value.Key); string[] dimensionValues = value.Value.ToArray(); Assert.Equal(2, dimensionValues.Length); Assert.Equal("netcoreapp1.0", dimensionValues[0]); Assert.Equal("net45", dimensionValues[1]); } }