Sha256: b1de5a89dd4a55d4a85d300ca37afa8e91c77356edf828d3c47df1cdfb6906d6

Contents?: true

Size: 1.17 KB

Versions: 28

Compression:

Stored size: 1.17 KB

Contents

// This file was auto-generated based on version 1.1.0 of the canonical data.

using Xunit;

public class PrimeFactorsTest
{
    [Fact]
    public void No_factors()
    {
        Assert.Empty(PrimeFactors.Factors(1));
    }

    [Fact(Skip = "Remove to run test")]
    public void Prime_number()
    {
        Assert.Equal(new[] { 2 }, PrimeFactors.Factors(2));
    }

    [Fact(Skip = "Remove to run test")]
    public void Square_of_a_prime()
    {
        Assert.Equal(new[] { 3, 3 }, PrimeFactors.Factors(9));
    }

    [Fact(Skip = "Remove to run test")]
    public void Cube_of_a_prime()
    {
        Assert.Equal(new[] { 2, 2, 2 }, PrimeFactors.Factors(8));
    }

    [Fact(Skip = "Remove to run test")]
    public void Product_of_primes_and_non_primes()
    {
        Assert.Equal(new[] { 2, 2, 3 }, PrimeFactors.Factors(12));
    }

    [Fact(Skip = "Remove to run test")]
    public void Product_of_primes()
    {
        Assert.Equal(new[] { 5, 17, 23, 461 }, PrimeFactors.Factors(901255));
    }

    [Fact(Skip = "Remove to run test")]
    public void Factors_include_a_large_prime()
    {
        Assert.Equal(new[] { 11, 9539, 894119 }, PrimeFactors.Factors(93819012551));
    }
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.179 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.178 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.177 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.176 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.175 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.174 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.173 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.172 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.171 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.170 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.169 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.167 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.166 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.165 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.164 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.163 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.162 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.161 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs
trackler-2.2.1.160 tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs