public SpecExecutionRequestTester()
        {
            var path = ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory()
                       .AppendPath("Storyteller.Samples", "Specs", "General", "Check properties.xml");

            theSpec = HierarchyLoader.ReadSpecHeader(path);
        }
Esempio n. 2
0
        public void can_read_max_retries()
        {
            var path = ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory()
                       .AppendPath("Storyteller.Samples", "Specs", "General", "Check properties.xml");

            var spec = HierarchyLoader.ReadSpecHeader(path);

            spec.MaxRetries.ShouldBe(3);
        }
Esempio n. 3
0
        public void the_spec_type_should_be_header_after_loading_a_spec_as_header()
        {
            var path = ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory()
                       .AppendPath("Storyteller.Samples", "Specs", "General", "Check properties.xml");

            var spec = HierarchyLoader.ReadSpecHeader(path);

            spec.SpecType.ShouldBe(SpecType.header);
        }
Esempio n. 4
0
        public void read_a_spec_node()
        {
            var path = ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory()
                       .AppendPath("Storyteller.Samples", "Specs", "General", "Check properties.xml");

            var spec = HierarchyLoader.ReadSpecHeader(path);

            spec.name.ShouldBe("Check properties");
            spec.Lifecycle.ShouldBe(Lifecycle.Acceptance);
            spec.id.ShouldBe("general1");
            spec.Filename.ShouldBe(path);


            spec.MaxRetries.ShouldBe(3);
        }
        public void read_spec_data_from_header_mode()
        {
            var path = ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory()
                       .AppendPath("Storyteller.Samples", "Specs", "General", "Check properties.xml");

            var spec = HierarchyLoader.ReadSpecHeader(path);

            spec.Children.Any().ShouldBeFalse();

            spec.SpecType.ShouldBe(SpecType.header);

            spec.ReadBody();

            spec.SpecType.ShouldBe(SpecType.full);

            spec.Children.Any().ShouldBeTrue();
        }
        public void Changed(string file)
        {
            try
            {
                _lock.Read(() =>
                {
                    var node = HierarchyLoader.ReadSpecHeader(file);
                    node.ReadBody();

                    if (_hierarchy.Specifications.Has(node.id))
                    {
                        var old   = _hierarchy.Specifications[node.id];
                        var suite = _hierarchy.Suites[old.SuitePath()];

                        suite.ReplaceSpecification(node);
                        _hierarchy.Specifications[node.id] = node;

                        node.WritePath(suite.path);



                        _client.SendMessageToClient(new SpecData
                        {
                            data    = node,
                            id      = node.id,
                            results = _results.ResultsFor(node.id).ToArray()
                        });
                    }



                    return(true);
                });
            }
            catch (Exception e)
            {
                _logger.Error("Failed to handle a changed file: " + file, e);
            }
        }