<commit_before>﻿using System;
using Xunit;
using Xbehave;
using System.Threading;

//public class SpecificationPrimitiveFacts
//{
//    [Fact]
//    public void CreatePrimitive_WithNullAction_Throws()
//    {
//        Assert.Throws<ArgumentNullException>( () => new SpecificationPrimitive<Action>( "", null ) );
//    }

//    [Fact]
//    public void CreatePrimitive_WithNullMessage_Throws()
//    {
//        Assert.Throws<ArgumentNullException>( () => new SpecificationPrimitive<Action>( null, () => { } ) );
//    }

//    [Fact]
//    public void Execute_Action_WithTimeout_FailsCorrectly()
//    {
//        SpecificationPrimitive<Action> sut = new SpecificationPrimitive<Action>( "", () => Thread.Sleep( 1000 ) );

//        sut.WithTimeout( 10 );

//        Assert.Throws<Xunit.Sdk.TimeoutException>( () => sut.Execute() );
//    }

//    [Fact]
//    public void Execute_Action_Timeout_HappyPath()
//    {
//        SpecificationPrimitive<Action> sut = new SpecificationPrimitive<Action>( "", () => { } );

//        sut.WithTimeout( 10 );

//        Assert.DoesNotThrow( () => sut.Execute() );
//    }

//    [Fact]
//    public void Execute_Action_NoTimeout_HappyPath()
//    {
//        SpecificationPrimitive<Action> sut = new SpecificationPrimitive<Action>( "", () => { } );

//        Assert.DoesNotThrow( () => sut.Execute() );
//    }

//    [Fact]
//    public void Execute_ContextDelegate_WithTimeout_FailsCorrectly()
//    {
//        SpecificationPrimitive<ContextDelegate> sut = new SpecificationPrimitive<ContextDelegate>( "",
//            () =>
//            {
//                Thread.Sleep( 20 );
//                return DisposableAction.None;
//            } );

//        sut.WithTimeout( 10 );

//        Assert.Throws<Xunit.Sdk.TimeoutException>( () => sut.Execute() );
//    }

//    [Fact]
//    public void Execute_ContextDelegate_WithTimeout_HappyPath()
//    {
//        SpecificationPrimitive<ContextDelegate> sut = new SpecificationPrimitive<ContextDelegate>( "", () => DisposableAction.None );

//        sut.WithTimeout( 10 );

//        var result = default( IDisposable );
//        Assert.DoesNotThrow( () => result = sut.Execute() );

//        Assert.Equal( DisposableAction.None, result );
//    }

//    [Fact]
//    public void Execute_ContextDelegate_NoTimeout_HappyPath()
//    {
//        SpecificationPrimitive<ContextDelegate> sut = new SpecificationPrimitive<ContextDelegate>( "", () => DisposableAction.None );

//        var result = default( IDisposable );
//        Assert.DoesNotThrow( () => result = sut.Execute() );

//        Assert.Equal( DisposableAction.None, result );
//    }
//}<commit_msg>fixed SpecificationPrimitiveFacts for StyleCop<commit_after>﻿// <copyright file="SpecificationPrimitiveFacts.cs" company="<NAME>">
//  Copyright (c) <NAME>. All rights reserved.
// </copyright>

namespace Xbehave.Test
{
    using System;
    using Xbehave;
    using Xunit;

    public class SpecificationPrimitiveFacts
    {
        [Fact]
        public void CreatePrimitive_WithNullAction_Throws()
        {
            Assert.Throws<ArgumentNullException>(() => new Step<Action>("foo", null));
        }

        [Fact]
        public void CreatePrimitive_WithNullMessage_Throws()
        {
            Assert.Throws<ArgumentNullException>(() => new Step<Action>(null, () => { }));
        }
    }
}
{'fraction_non_alphanumeric': 0.15700267618198038, 'fraction_numerical': 0.004162949747249479, 'mean_word_length': 2.5410526315789475, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3134110', 'n_tokens_mistral': 1006, 'n_tokens_neox': 984, 'n_words': 159}