diff --git a/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs b/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs index 1ea7499b..5155be51 100644 --- a/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs +++ b/COMET.Web.Common.Tests/Utilities/CherryPick/CherryPickRunnerTestFixture.cs @@ -22,45 +22,46 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace COMET.Web.Common.Tests.Utilities.CherryPick; - -using NUnit.Framework; - -using CDP4Common.SiteDirectoryData; +namespace COMET.Web.Common.Tests.Utilities.CherryPick +{ + using NUnit.Framework; -using Moq; + using CDP4Common.SiteDirectoryData; -[TestFixture] -public class CherryPickRunnerTestFixture -{ - private Common.Utilities.CherryPick.CherryPickRunner viewModel; - private Mock sessionService; - private Mock needCherryPickedData; + using Moq; - [SetUp] - public void Setup() + [TestFixture] + public class CherryPickRunnerTestFixture { - this.sessionService = new Mock(); - this.needCherryPickedData = new Mock(); - this.viewModel = new Common.Utilities.CherryPick.CherryPickRunner(this.sessionService.Object); - } + private Common.Utilities.CherryPick.CherryPickRunner viewModel; + private Mock sessionService; + private Mock needCherryPickedData; - [Test] - public async Task VerifyProperties() - { - Assert.That(this.viewModel.IsCherryPicking, Is.False); - this.viewModel.InitializeProperties(new List { this.needCherryPickedData.Object }); + [SetUp] + public void Setup() + { + this.sessionService = new Mock(); + this.needCherryPickedData = new Mock(); + this.viewModel = new Common.Utilities.CherryPick.CherryPickRunner(this.sessionService.Object); + } + + [Test] + public async Task VerifyProperties() + { + Assert.That(this.viewModel.IsCherryPicking, Is.False); + this.viewModel.InitializeProperties(new List { this.needCherryPickedData.Object }); - this.sessionService.Setup(x => x.Session.RetrieveSiteDirectory()).Returns(new SiteDirectory()); + this.sessionService.Setup(x => x.Session.RetrieveSiteDirectory()).Returns(new SiteDirectory()); - var propertyInfo = typeof(Common.Utilities.CherryPick.CherryPickRunner).GetProperty("IsCherryPicking", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); + var propertyInfo = typeof(Common.Utilities.CherryPick.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); + propertyInfo?.SetValue(this.viewModel, true, null); + await this.viewModel.RunCherryPick(); + 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); + propertyInfo?.SetValue(this.viewModel, false, null); + await this.viewModel.RunCherryPick(); + this.needCherryPickedData.Verify(x => x.ProcessCherryPickedData(Moq.It.IsAny>>()), Times.Once); + } } }