public void Execute_AllPropertiesAreSet() { // Arrange var testFolder = TestUtils.CreateTestSpecificFolderWithSubPaths(TestContext); var task = new WriteProjectConfigFile { ConfigDir = testFolder, AnalysisConfigPath = "not empty", ProjectPath = "not empty", FilesToAnalyzePath = "not empty", OutPath = "not empty", IsTest = true, TargetFramework = "not empty" }; // Act var reloadedConfig = ExecuteAndReloadConfig(task, testFolder); // Assert foreach (var property in reloadedConfig.GetType().GetProperties()) { var value = property.GetValue(reloadedConfig)?.ToString(); value.Should().NotBeNullOrEmpty($"property '{property.Name}' should have value"); } }
public void Execute_FileCreated() { // Arrange var testFolder = TestUtils.CreateTestSpecificFolderWithSubPaths(TestContext); var task = new WriteProjectConfigFile { ConfigDir = testFolder, AnalysisConfigPath = @"c:\fullPath\config.xml", ProjectPath = @"c:\fullPath\project.xproj", FilesToAnalyzePath = @"c:\fullPath\files.txt", OutPath = @"c:\fullPath\out\42\", IsTest = false, TargetFramework = "target-42" }; // Act var reloadedConfig = ExecuteAndReloadConfig(task, testFolder); // Assert reloadedConfig.AnalysisConfigPath.Should().Be(@"c:\fullPath\config.xml"); reloadedConfig.ProjectPath.Should().Be(@"c:\fullPath\project.xproj"); reloadedConfig.OutPath.Should().Be(@"c:\fullPath\out\42\"); reloadedConfig.FilesToAnalyzePath.Should().Be(@"c:\fullPath\files.txt"); reloadedConfig.ProjectType.Should().Be(ProjectType.Product); reloadedConfig.TargetFramework.Should().Be("target-42"); }
public void Execute_IsTest_FalseReturnsTypeProduct() { // Arrange var testFolder = TestUtils.CreateTestSpecificFolderWithSubPaths(TestContext); var task = new WriteProjectConfigFile { ConfigDir = testFolder, IsTest = false, }; // Act var reloadedConfig = ExecuteAndReloadConfig(task, testFolder); // Assert reloadedConfig.ProjectType.Should().Be(ProjectType.Product); }