Пример #1
0
        public void SendHierarchyToClient()
        {
            var message = new HierarchyLoaded
            {
                hierarchy = _hierarchy.Top
            };

            _client.SendMessageToClient(message);
        }
        public Batch BuildInitialModel()
        {
            var hierarchyLoaded = new HierarchyLoaded(Persistence.Hierarchy.Top, Persistence.Results);

            var batch = new Batch(LatestSystemRecycled, hierarchyLoaded);

            QueueState.AddInitialMessages(batch);


            return(batch);
        }
Пример #3
0
        public void write_initial_model()
        {
            // You need to compile everything before trying to use this
            var input = new ProjectInput
            {
                Path =
                    AppDomain.CurrentDomain.BaseDirectory.ParentDirectory()
                    .ParentDirectory()
                    .ParentDirectory()
                    .AppendPath("Storyteller.Samples"),

                ProfileFlag = "Safari"
            };

            using (var controller = input.BuildRemoteController())
            {
                controller.Start(EngineMode.Batch).Wait(30.Seconds());

                var hierarchy = HierarchyLoader.ReadHierarchy(input.Path.AppendPath("Specs"));
                var request   = new BatchRunRequest
                {
                    SpecPath = input.SpecPath
                };

                var response = controller.Send(request).AndWaitFor <BatchRunResponse>();


                var cache = new ResultsCache();
                response.Result.records.Each(
                    x =>
                {
                    var completed = new SpecExecutionCompleted(x.specification.id, x.results, x.specification);
                    cache.Store(completed);
                });

                response.Result.fixtures = controller.LatestSystemRecycled.fixtures;


                var hierarchyLoaded = new HierarchyLoaded(hierarchy, cache);

                var initialization = new InitialModel(controller.LatestSystemRecycled, hierarchyLoaded)
                {
                    wsAddress = "ws://localhost:" + 8200
                };

                writeResponse(response.Result);
                //writeInitialization(initialization);
            }
        }
Пример #4
0
        public void clear_all_results()
        {
            ClassUnderTest.Receive(new SpecExecutionCompleted("sentence4", new SpecResults(), new Specification()));
            ClassUnderTest.Receive(new SpecExecutionCompleted("general1", new SpecResults(), new Specification()));
            ClassUnderTest.Receive(new SpecExecutionCompleted("general2", new SpecResults(), new Specification()));
            ClassUnderTest.Receive(new SpecExecutionCompleted("table1", new SpecResults(), new Specification()));

            ClassUnderTest.ClearAllResults();

            ClassUnderTest.AllCachedResults().Any().ShouldBeFalse();

            var hierarchyLoaded = new HierarchyLoaded(ClassUnderTest.Hierarchy.Top, ClassUnderTest.Results);

            MockFor <IClientConnector>().Received().SendMessageToClient(hierarchyLoaded);
        }
        //[Fact]
        public void write_initial_model()
        {
            // You need to compile everything before trying to use this
            var input = new ProjectInput(EngineMode.Batch)
            {
                Path =
                    samplesFolder,
                ProfileFlag = "Safari"
            };

            using (var controller = input.BuildEngine())
            {
                controller.Start().Wait(30.Seconds());

                var hierarchy = HierarchyLoader.ReadHierarchy(input.Path.AppendPath("Specs"));
                var request   = new BatchRunRequest
                {
                    SpecPath = input.SpecPath
                };

                var response = controller.Send(request).AndWaitFor <BatchRunResponse>();


                var cache = new ResultsCache();
                response.Result.records.Each(
                    x =>
                {
                    var completed = new SpecExecutionCompleted(x.specification.id, x.results, x.specification);
                    cache.Store(completed);
                });

                response.Result.fixtures = controller.LatestSystemRecycled.fixtures;


                var hierarchyLoaded = new HierarchyLoaded(hierarchy, cache);

                writeResponse(response.Result);
                //writeInitialization(initialization);
            }
        }
        public void SendHierarchyToClient()
        {
            var message = new HierarchyLoaded(_hierarchy.Top, _results);

            _client.SendMessageToClient(message);
        }