<commit_before>﻿//  --------------------------------------------------------------------------------------------------------------------
//  <copyright file="WhenParsingCucumberJsonResultsFile.cs" company="PicklesDoc">
//  Copyright 2011 <NAME>
//  Copyright 2012-present PicklesDoc team and community contributors
//
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//  </copyright>
//  --------------------------------------------------------------------------------------------------------------------

using System;

using NFluent;

using NUnit.Framework;

using PicklesDoc.Pickles.ObjectModel;
using PicklesDoc.Pickles.TestFrameworks.CucumberJson;

using Feature = PicklesDoc.Pickles.ObjectModel.Feature;

namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson
{
    [TestFixture]
    public class WhenParsingCucumberJsonResultsFile : WhenParsingTestResultFiles<CucumberJsonResults>
    {
        public WhenParsingCucumberJsonResultsFile()
            : base("CucumberJson." + "results-example-json.json")
        {
        }

        [Test]
        public void ThenCanReadFeatureResultSuccessfully()
        {
            var results = ParseResultsFile();

            var feature = new Feature { Name = "Test Feature" };
            TestResult result = results.GetFeatureResult(feature);

            Check.That(result).IsEqualTo(TestResult.Failed);
        }

        [Test]
        public void ThenCanReadScenarioResultSuccessfully()
        {
            var results = ParseResultsFile();

            var feature = new Feature { Name = "Test Feature" };

            var scenario1 = new Scenario { Name = "Passing", Feature = feature };
            TestResult result1 = results.GetScenarioResult(scenario1);

            Check.That(result1).IsEqualTo(TestResult.Passed);

            var scenario2 = new Scenario { Name = "Failing", Feature = feature };
            TestResult result2 = results.GetScenarioResult(scenario2);

            Check.That(result2).IsEqualTo(TestResult.Failed);
        }

        [Test]
        public void ThenCanReadFeatureWithoutScenariosSuccessfully_ShouldReturnInconclusive()
        {
            var results = ParseResultsFile();
            var feature = new Feature { Name = "Feature Without Scenarios" };

            TestResult result = results.GetFeatureResult(feature);

            Check.That(result).IsEqualTo(TestResult.Inconclusive);
        }
    }
}<commit_msg>Use standard test suite for Cucumber JSON<commit_after>﻿//  --------------------------------------------------------------------------------------------------------------------
//  <copyright file="WhenParsingCucumberJsonResultsFile.cs" company="PicklesDoc">
//  Copyright 2011 <NAME>
//  Copyright 2012-present PicklesDoc team and community contributors
//
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//  </copyright>
//  --------------------------------------------------------------------------------------------------------------------

using System;

using NUnit.Framework;

using PicklesDoc.Pickles.TestFrameworks.CucumberJson;

namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson
{
    [TestFixture]
    public class WhenParsingCucumberJsonResultsFile : StandardTestSuite<CucumberJsonResults>
    {
        public WhenParsingCucumberJsonResultsFile()
            : base("CucumberJson." + "results-example-json.json")
        {
        }

        [Test]
        public new void ThenCanReadFeatureResultSuccessfully()
        {
            base.ThenCanReadFeatureResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadScenarioOutlineResultSuccessfully()
        {
            base.ThenCanReadScenarioOutlineResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadSuccessfulScenarioResultSuccessfully()
        {
            base.ThenCanReadSuccessfulScenarioResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadFailedScenarioResultSuccessfully()
        {
            base.ThenCanReadFailedScenarioResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadIgnoredScenarioResultSuccessfully()
        {
            base.ThenCanReadIgnoredScenarioResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadInconclusiveScenarioResultSuccessfully()
        {
            base.ThenCanReadInconclusiveScenarioResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadInconclusiveFeatureResultSuccessfully()
        {
            base.ThenCanReadInconclusiveFeatureResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadPassedFeatureResultSuccessfully()
        {
            base.ThenCanReadPassedFeatureResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadFailedFeatureResultSuccessfully()
        {
            base.ThenCanReadFailedFeatureResultSuccessfully();
        }

        [Test]
        public new void ThenCanReadNotFoundScenarioCorrectly()
        {
            base.ThenCanReadNotFoundScenarioCorrectly();
        }

        [Test]
        public new void ThenCanReadNotFoundFeatureCorrectly()
        {
            base.ThenCanReadNotFoundFeatureCorrectly();
        }

        [Test]
        public new void ThenCanReadResultsWithBackslashes()
        {
            base.ThenCanReadResultsWithBackslashes();
        }
    }
}
{'fraction_non_alphanumeric': 0.14711359404096835, 'fraction_numerical': 0.004965859714463066, 'mean_word_length': 2.0458412098298675, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '22754', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1547, 'n_words': 380}