public void ShouldUseBuildLogTransformerToGenerateView()
		{
			DynamicMock buildLogTransformerMock = new DynamicMock(typeof(IBuildLogTransformer));
			DynamicMock cruiseRequestMock = new DynamicMock(typeof(ICruiseRequest));
			DynamicMock buildSpecifierMock = new DynamicMock(typeof(IBuildSpecifier));
			DynamicMock requestStub = new DynamicMock(typeof(IRequest));

			ICruiseRequest cruiseRequest = (ICruiseRequest) cruiseRequestMock.MockInstance;
			IBuildSpecifier buildSpecifier = (IBuildSpecifier) buildSpecifierMock.MockInstance;
			IRequest request = (IRequest) requestStub.MockInstance;

			cruiseRequestMock.ExpectAndReturn("BuildSpecifier", buildSpecifier);
			cruiseRequestMock.SetupResult("Request", request);
			requestStub.SetupResult("ApplicationPath", "myAppPath");
			Hashtable expectedXsltArgs = new Hashtable();
			expectedXsltArgs["applicationPath"] = "myAppPath";
			buildLogTransformerMock.ExpectAndReturn("Transform", "transformed", buildSpecifier, new string[] { @"xsl\myxsl.xsl" }, new HashtableConstraint(expectedXsltArgs), null);

			XslReportBuildAction action = new XslReportBuildAction((IBuildLogTransformer) buildLogTransformerMock.MockInstance, null);
			action.XslFileName = @"xsl\myxsl.xsl";

			Assert.AreEqual("transformed", ((HtmlFragmentResponse)action.Execute(cruiseRequest)).ResponseFragment);

			buildLogTransformerMock.Verify();
			cruiseRequestMock.Verify();
			buildSpecifierMock.Verify();
		}
		public void ShouldUseObjectGiverToInstantiateActions()
		{
			DynamicMock objectSourceMock = new DynamicMock(typeof(ObjectSource));
			Type typeToInstantiate = typeof(XslReportBuildAction);
			ICruiseAction instantiated = new XslReportBuildAction(null, null);
			objectSourceMock.ExpectAndReturn("GetByType", instantiated, typeToInstantiate);

			ActionInstantiatorWithObjectSource instantiator = new ActionInstantiatorWithObjectSource((ObjectSource) objectSourceMock.MockInstance);
			Assert.AreEqual(instantiated, instantiator.InstantiateAction(typeToInstantiate));
			objectSourceMock.Verify();
		}
		public void ShouldCreateAnXslReportActionWithCorrectNameXslFileName()
		{
			buildPlugin.ActionName = "MyAction";
			buildPlugin.ConfiguredLinkDescription = "My Plugin";
			buildPlugin.XslFileName = @"xsl\myxsl.xsl";

			XslReportBuildAction xslReportAction = new XslReportBuildAction(null, null);
			actionInstantiatorMock.ExpectAndReturn("InstantiateAction", xslReportAction, typeof(XslReportBuildAction));

			INamedAction[] namedActions = buildPlugin.NamedActions;

			Assert.AreEqual(1, namedActions.Length);
			Assert.AreEqual("MyAction", namedActions[0].ActionName);
			Assert.AreEqual(xslReportAction, namedActions[0].Action);
			Assert.AreEqual(@"xsl\myxsl.xsl", ((XslReportBuildAction) namedActions[0].Action).XslFileName);

			VerifyAll();
		}