This commit is contained in:
parent
a00e84e111
commit
de2eb52756
@ -18,5 +18,3 @@ jobs:
|
|||||||
run: dotnet build
|
run: dotnet build
|
||||||
- name: "✅ Test"
|
- name: "✅ Test"
|
||||||
run: dotnet test
|
run: dotnet test
|
||||||
- name: "Sophie bah caca"
|
|
||||||
run: echo "Louis est le meilleur"
|
|
@ -4,6 +4,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iteration", "Iteration\Iter
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{A838FD78-1D97-4191-91BF-FF439C9FB918}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{A838FD78-1D97-4191-91BF-FF439C9FB918}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stream", "Stream\Stream.csproj", "{43060AB1-3A2B-4EEE-AC6E-A476EDDC71A2}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -18,5 +20,9 @@ Global
|
|||||||
{A838FD78-1D97-4191-91BF-FF439C9FB918}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A838FD78-1D97-4191-91BF-FF439C9FB918}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A838FD78-1D97-4191-91BF-FF439C9FB918}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A838FD78-1D97-4191-91BF-FF439C9FB918}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A838FD78-1D97-4191-91BF-FF439C9FB918}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A838FD78-1D97-4191-91BF-FF439C9FB918}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{43060AB1-3A2B-4EEE-AC6E-A476EDDC71A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{43060AB1-3A2B-4EEE-AC6E-A476EDDC71A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{43060AB1-3A2B-4EEE-AC6E-A476EDDC71A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{43060AB1-3A2B-4EEE-AC6E-A476EDDC71A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=394010b2_002Df74a_002D42b6_002D8445_002D2a75606c26a3/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &lt;Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=6f052d53_002D9b1d_002D49af_002D8be5_002Da3b6ca9fbd46/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &lt;Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||||
<Project Location="/Users/louisgallet/Developer/EPITA/B2BEpita/Tests" Presentation="&lt;Tests&gt;" />
|
<Project Location="/Users/louisgallet/Developer/EPITA/B2BEpita/Tests" Presentation="&lt;Tests&gt;" />
|
||||||
</SessionState></s:String></wpf:ResourceDictionary>
|
</SessionState></s:String></wpf:ResourceDictionary>
|
35
Iteration/Recursion.cs
Normal file
35
Iteration/Recursion.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
namespace Iteration;
|
||||||
|
|
||||||
|
public class Recursion
|
||||||
|
{
|
||||||
|
public static bool IsAlphanum(string s, int i)
|
||||||
|
{
|
||||||
|
if (i >= s.Length)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z') || (s[i] >= '0' && s[i] <= '9'))
|
||||||
|
{
|
||||||
|
return IsAlphanum(s, i + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ReverseStr(string source, int lenght)
|
||||||
|
{
|
||||||
|
if (lenght == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return source[lenght - 1] + ReverseStr(source, lenght - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
Stream/Program.cs
Normal file
3
Stream/Program.cs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// See https://aka.ms/new-console-template for more information
|
||||||
|
|
||||||
|
Console.WriteLine("Hello, World!");
|
10
Stream/Stream.cs
Normal file
10
Stream/Stream.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace Stream;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
public class Stream
|
||||||
|
{
|
||||||
|
public static bool ExistFile(string path)
|
||||||
|
{
|
||||||
|
return File.Exists(path);
|
||||||
|
}
|
||||||
|
}
|
10
Stream/Stream.csproj
Normal file
10
Stream/Stream.csproj
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
27
Tests/Interatif/RecursionTest.cs
Normal file
27
Tests/Interatif/RecursionTest.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
namespace Tests.Recursion;
|
||||||
|
|
||||||
|
public class RecursionTest
|
||||||
|
{
|
||||||
|
[Theory]
|
||||||
|
[InlineData("abcdef132", 0, true)]
|
||||||
|
[InlineData("!abcdef", 0, false)]
|
||||||
|
[InlineData("!abcdef", 1, true)]
|
||||||
|
[InlineData("abcdef!", 15, true)]
|
||||||
|
|
||||||
|
public void IsAlphanumTest(string s, int i, bool expected)
|
||||||
|
{
|
||||||
|
bool actual = Iteration.Recursion.IsAlphanum(s, i);
|
||||||
|
Assert.Equal(expected, actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData("42", 2, "24")]
|
||||||
|
[InlineData("123", 3, "321")]
|
||||||
|
[InlineData("ABcdeF",6, "FedcBA")]
|
||||||
|
|
||||||
|
public void ReverseStrTest(string source, int lenght, string expected)
|
||||||
|
{
|
||||||
|
string actual = Iteration.Recursion.ReverseStr(source, lenght);
|
||||||
|
Assert.Equal(expected, actual);
|
||||||
|
}
|
||||||
|
}
|
6
Tests/Stream/StreamTest.cs
Normal file
6
Tests/Stream/StreamTest.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Tests.Stream;
|
||||||
|
|
||||||
|
public class StreamTest
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user