diff --git a/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs b/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs index 1b460b8f..f3bb06ec 100644 --- a/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs +++ b/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs @@ -28,7 +28,8 @@ namespace COMET.Web.Common.Tests.Utilities.CherryPick { using NUnit.Framework; - using CDP4Common.SiteDirectoryData; + using SiteDirectory = CDP4Common.SiteDirectoryData.SiteDirectory; + using CDP4Common.DTO; using COMET.Web.Common.Services.SessionManagement; using COMET.Web.Common.Utilities.CherryPick; @@ -61,12 +62,24 @@ public async Task VerifyProperties() var propertyInfo = typeof(CherryPickRunner).GetProperty("IsCherryPicking", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); propertyInfo?.SetValue(this.viewModel, true, null); - await this.viewModel.RunCherryPick(); - this.needCherryPickedData.Verify(x => x.ProcessCherryPickedData(Moq.It.IsAny>>()), Times.Never); + await this.viewModel.RunCherryPickAsync(); + this.needCherryPickedData.Verify(x => x.ProcessCherryPickedData(Moq.It.IsAny>>()), Times.Never); propertyInfo?.SetValue(this.viewModel, false, null); - await this.viewModel.RunCherryPick(); - this.needCherryPickedData.Verify(x => x.ProcessCherryPickedData(Moq.It.IsAny>>()), Times.Once); + await this.viewModel.RunCherryPickAsync(); + this.needCherryPickedData.Verify(x => x.ProcessCherryPickedData(Moq.It.IsAny>>()), Times.Once); + + this.needCherryPickedData.Invocations.Clear(); + + var engineeringModelId = Guid.NewGuid(); + var iterationId = Guid.NewGuid(); + propertyInfo?.SetValue(this.viewModel, true, null); + await this.viewModel.RunSingleCherryPickAsync(engineeringModelId, iterationId); + this.needCherryPickedData.Verify(x => x.ProcessCherryPickedData(Moq.It.IsAny>>()), Times.Never); + + propertyInfo?.SetValue(this.viewModel, false, null); + await this.viewModel.RunSingleCherryPickAsync(engineeringModelId, iterationId); + this.needCherryPickedData.Verify(x => x.ProcessCherryPickedData(Moq.It.IsAny>>()), Times.Once); } } }