Sha256: cc6f27f5f9e4d43689d2fe38acfab3f705d25fa8cad42a9304f9c9d523f2113e

Contents?: true

Size: 1.36 KB

Versions: 115

Compression:

Stored size: 1.36 KB

Contents

using Xunit;

public class PhoneNumberTest
{
    [Fact]
    public void Cleans_parens_spaces_and_dashes()
    {
        var phone = new PhoneNumber("(123) 456-7890");
        Assert.Equal("1234567890", phone.Number);
    }

    [Fact(Skip = "Remove to run test")]
    public void Cleans_numbers_with_dots()
    {
        var phone = new PhoneNumber("123.456.7890");
        Assert.Equal("1234567890", phone.Number);
    }

    [Fact(Skip = "Remove to run test")]
    public void Allows_us_country_code()
    {
        var phone = new PhoneNumber("11234567890");
        Assert.Equal("1234567890", phone.Number);
    }

    [Fact(Skip = "Remove to run test")]
    public void Invalid_when_11_digits()
    {
        var phone = new PhoneNumber("21234567890");
        Assert.Equal("0000000000", phone.Number);
    }

    [Fact(Skip = "Remove to run test")]
    public void Invalid_when_9_digits()
    {
        var phone = new PhoneNumber("123456789");
        Assert.Equal("0000000000", phone.Number);
    }

    [Fact(Skip = "Remove to run test")]
    public void Has_an_area_code()
    {
        var phone = new PhoneNumber("1234567890");
        Assert.Equal("123", phone.AreaCode);
    }

    [Fact(Skip = "Remove to run test")]
    public void Formats_a_number()
    {
        var phone = new PhoneNumber("1234567890");
        Assert.Equal("(123) 456-7890", phone.ToString());
    }
}

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
trackler-2.2.1.12 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.11 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.10 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.9 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.8 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.7 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.6 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.5 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.4 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.3 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.2 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.1 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.1.0 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.0.6 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.0.5 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.0.4 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.0.3 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.0.2 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.0.1 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs
trackler-2.2.0.0 tracks/csharp/exercises/phone-number/PhoneNumberTest.cs