<commit_before>﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using Microsoft.TestCommon;

namespace System.Web.Http.Routing.Constraints
{
    public class AlphaHttpRouteConstraintTest : HttpRouteConstraintTestBase
    {
        [Fact]
        public void Match_FailsWhenValueContainsNumber()
        {
            AlphaHttpRouteConstraint constraint = new AlphaHttpRouteConstraint();
            bool match = TestValue(constraint, "abc123");
            Assert.False(match);
        }

        [Fact]
        public void Match_SucceedsWhenValueContainsNonAlphaNum()
        {
            AlphaHttpRouteConstraint constraint = new AlphaHttpRouteConstraint();
            bool match = TestValue(constraint, "abc_");
            Assert.False(match);
        }

        [Fact]
        public void Match_SucceedsWhenValueIsAlpha()
        {
            AlphaHttpRouteConstraint constraint = new AlphaHttpRouteConstraint();
            bool match = TestValue(constraint, "abcABC");
            Assert.True(match);
        }
    }<commit_msg>renamed test to reflect the condition being tested.<commit_after>﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using Microsoft.TestCommon;

namespace System.Web.Http.Routing.Constraints
{
    public class AlphaHttpRouteConstraintTest : HttpRouteConstraintTestBase
    {
        [Fact]
        public void Match_FailsWhenValueContainsNonAlphaNum()
        {
            AlphaHttpRouteConstraint constraint = new AlphaHttpRouteConstraint();
            bool match = TestValue(constraint, "abc_");
            Assert.False(match);
        }

        [Fact]
        public void Match_FailsWhenValueContainsNumber()
        {
            AlphaHttpRouteConstraint constraint = new AlphaHttpRouteConstraint();
            bool match = TestValue(constraint, "abc123");
            Assert.False(match);
        }

        [Fact]
        public void Match_SucceedsWhenValueIsAlpha()
        {
            AlphaHttpRouteConstraint constraint = new AlphaHttpRouteConstraint();
            bool match = TestValue(constraint, "abcABC");
            Assert.True(match);
        }
    }
{'fraction_non_alphanumeric': 0.07577748576434516, 'fraction_numerical': 0.002628120893561104, 'mean_word_length': 2.5743348982785603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4267055', 'n_tokens_mistral': 549, 'n_tokens_neox': 537, 'n_words': 139}