Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
coenm committed Aug 15, 2023
1 parent 7f839de commit 5e2e356
Showing 1 changed file with 19 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public RepositorySpecificConfigurationTest()
new DateTimeTimeVariableProvider(dateTimeTimeVariableProviderOptions),
new DateTimeDateVariableProvider(dateTimeDateVariableProviderOptions),
new EmptyVariableProvider(),
new VariableProviderAdapter(new []
new VariableProviderAdapter(new Core.Plugin.VariableProviders.IVariableProvider[]
{
(RepoM.Core.Plugin.VariableProviders.IVariableProvider)new CustomEnvironmentVariableVariableProvider(),
(RepoM.Core.Plugin.VariableProviders.IVariableProvider)new RepoMVariableProvider(),
(RepoM.Core.Plugin.VariableProviders.IVariableProvider)new RepositoryVariableProvider(),
new CustomEnvironmentVariableVariableProvider(),
new RepoMVariableProvider(),
new RepositoryVariableProvider(),
}),
new SlashVariableProvider(),
new BackslashVariableProvider(),
Expand Down Expand Up @@ -142,17 +142,7 @@ public async Task Create_ShouldRespectMultiSelectRepos()
_testFileSettings.UseFileName("RepositoryActionsMultiSelect");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
_fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
_actionMapperComposition,
_translationService,
new RepositoryConfigurationReader(
_appDataPathProvider,
_fileSystem,
_yamlAppSettingsDeserializer,
_repositoryExpressionEvaluator,
NullLogger.Instance));
RepositorySpecificConfiguration sut = CreateSut();

// act
IEnumerable<RepositoryActionBase> result = sut.CreateActions(new Repository("path1"), new Repository("path2"));
Expand All @@ -168,17 +158,7 @@ public async Task Create_ShouldNotCareAboutMultiSelectRepos_WhenSingleRepo()
_testFileSettings.UseFileName("RepositoryActionsMultiSelect");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
_fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
_actionMapperComposition,
_translationService,
new RepositoryConfigurationReader(
_appDataPathProvider,
_fileSystem,
_yamlAppSettingsDeserializer,
_repositoryExpressionEvaluator,
NullLogger.Instance));
RepositorySpecificConfiguration sut = CreateSut();

// act
IEnumerable<RepositoryActionBase> result = sut.CreateActions(new Repository("path1"));
Expand All @@ -194,17 +174,7 @@ public async Task Create_ShouldOnlyProcessActiveItems()
_testFileSettings.UseFileName("RepositoryActions1");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
_fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
_actionMapperComposition,
_translationService,
new RepositoryConfigurationReader(
_appDataPathProvider,
_fileSystem,
_yamlAppSettingsDeserializer,
_repositoryExpressionEvaluator,
NullLogger.Instance));
RepositorySpecificConfiguration sut = CreateSut();

// act
IEnumerable<RepositoryActionBase> result = sut.CreateActions(new Repository("path1"));
Expand All @@ -220,7 +190,18 @@ public async Task Create_ShouldProcessSeparator1()
_testFileSettings.UseFileName("RepositoryActionsWithSeparator1");
var content = await EasyTestFile.LoadAsText(_testFileSettings);
_fileSystem.AddFile(Path.Combine(_tempPath, RepositoryConfigurationReader.FILENAME), new MockFileData(content, Encoding.UTF8));
var sut = new RepositorySpecificConfiguration(
RepositorySpecificConfiguration sut = CreateSut();

// act
IEnumerable<RepositoryActionBase> result = sut.CreateActions(new Repository("path1"));

// assert
await Verifier.Verify(result, _verifySettings);
}

private RepositorySpecificConfiguration CreateSut()
{
return new RepositorySpecificConfiguration(
_fileSystem,
_repositoryExpressionEvaluator,
_actionMapperComposition,
Expand All @@ -231,11 +212,5 @@ public async Task Create_ShouldProcessSeparator1()
_yamlAppSettingsDeserializer,
_repositoryExpressionEvaluator,
NullLogger.Instance));

// act
IEnumerable<RepositoryActionBase> result = sut.CreateActions(new Repository("path1"));

// assert
await Verifier.Verify(result, _verifySettings);
}
}

0 comments on commit 5e2e356

Please sign in to comment.