Esempio n. 1
0
        public static StoryResult Run(this Story story, ILauncherClient client)
        {
            var storyResult = Behavior.Kernel.Get<StoryResult>();

            storyResult.StoryName = story.Name;

            MapScenarios(story);

            testScenarios = Behavior.Kernel.Get<IScenarioBuilder>().Build(testScenarios);

            var fixtureUrl = "http://" + Behavior.Config.Host + "/" + Behavior.Config.FixtureContext;

            var httpResult = client.RequestFixtureLaunch(fixtureUrl, 10);

            if (httpResult.status.ToLower().Equals("pass"))
            {
                var proxy = XmlRpcProxyGen.Create(typeof(IRemoteClient)) as IRemoteClient;

                proxy.Url = httpResult.retrn.ToString();

                storyResult = RunScenarios(storyResult, proxy);

                client.StopFixtureServer(fixtureUrl);

                storyResult.SetResult();

                return storyResult;
            }
            else
            {
                var scenarioResult = new ScenarioResult();

                scenarioResult.InteractionResults.Add(new InteractionResult(httpResult));

                scenarioResult.SetResult();

                storyResult.ScenarioResults.Add(scenarioResult);

                storyResult.SetResult();

                return storyResult;
            }
        }