public void RunShouldCallXdtTransform(IXdtTransformEngine xdt, IFilePathResolver path) { var postStep = new PostStep(xdt, path); //act postStep.Run(null, null); xdt.Received(1).ApplyConfigTransformation(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()); }
public void RunShouldNotCallXdtTransformIfTransformFileIsMissing(IXdtTransformEngine xdt, IFilePathResolver path) { path.MapPath(Arg.Any <string>()).Returns((string)null); var postStep = new PostStep(xdt, path); //act postStep.Run(null, null); xdt.DidNotReceive().ApplyConfigTransformation(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()); }
public void RunShouldCallXdtTransform(IXdtTransformEngine xdt, IFilePathResolver path, ITransformsProvider transform) { var postStep = new PostStep(xdt, path, transform); transform.GetTransformsByLayer(Arg.Any<string>()).Returns(new List<string>() {"web.config.transform"}); //act postStep.Run(null, null); xdt.Received().ApplyConfigTransformation(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<string>()); }
public void RunShouldNotCallXdtTransformIfTransformFileIsMissing(IXdtTransformEngine xdt, IFilePathResolver path) { path.MapPath(Arg.Any<string>()).Returns((string)null); var postStep = new PostStep(xdt, path); //act postStep.Run(null, null); xdt.DidNotReceive().ApplyConfigTransformation(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<string>()); }
public void RunShouldCallXdtTransform(IXdtTransformEngine xdt, IFilePathResolver path) { var postStep = new PostStep(xdt, path); //act postStep.Run(null, null); xdt.Received(1).ApplyConfigTransformation(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<string>()); }
public void Run_NotExistingType_LogError(MemoryAppender appender, PostStep postStep) { //Arrange BasicConfigurator.Configure(appender); var nameValueCollection = new NameValueCollection(); nameValueCollection.Add("Attributes", "NotExistingType"); //Act postStep.Run(null, nameValueCollection); //Assert appender.Events.Should().Contain(x => x.Level == Level.ERROR && x.RenderedMessage.Contains("NotExistingType")); }
public void Run_TwoCorrectPostStepAction_CallBothPostSteps(PostStep postStep) { //Arrange FakePostStepAction.CallCount = 0; var nameValueCollection = new NameValueCollection(); nameValueCollection.Add("Attributes", "name1=Sitecore.Foundation.Installer.Tests.PostStepTests+FakePostStepAction, Sitecore.Foundation.Installer.Tests|name2=Sitecore.Foundation.Installer.Tests.PostStepTests+FakePostStepAction, Sitecore.Foundation.Installer.Tests|"); //Act postStep.Run(null, nameValueCollection); //Assert FakePostStepAction.CallCount.Should().Be(2); }
public void RunShouldCallXdtTransform(IXdtTransformEngine xdt, IFilePathResolver path, ITransformsProvider transform) { var postStep = new PostStep(xdt, path, transform); transform.GetTransformsByLayer(Arg.Any <string>()).Returns(new List <string>() { "web.config.transform" }); //act postStep.Run(null, null); xdt.Received().ApplyConfigTransformation(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()); }