Skip to content

Commit 20b0bf2

Browse files
authored
refactor: update namespace (#77)
1 parent 694786e commit 20b0bf2

25 files changed

+49
-47
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
# Disable sending usage data to Microsoft
1212
DOTNET_CLI_TELEMETRY_OPTOUT: true
1313
# Project name to pack and publish
14-
PROJECT_NAME: Dedge.Cardidy
14+
PROJECT_NAME: DEdge.Cardidy
1515
# GitHub Packages Feed settings
1616
GITHUB_FEED: https://nuget.pkg.github.com/d-edge/
1717
GITHUB_USER: aloisdg

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In a library like Cardidy, one of the main way to contribute is by adding a new
4242
- Clone the project and checkout the `main` branch
4343
- From `main` create a new branch named `feat/addXxx`
4444
- Create a card for Xxx
45-
- Open `src/Dedge.Cardidy/Model/Cards.cs`
45+
- Open `src/DEdge.Cardidy/Model/Cards.cs`
4646
- Add a new record for you card
4747

4848
```csharp
@@ -82,7 +82,7 @@ internal record Verve : ACard
8282

8383
```
8484

85-
- Then, open `src/Dedge.Cardidy/Cardidy.cs`
85+
- Then, open `src/DEdge.Cardidy/Cardidy.cs`
8686
- And add the new card to the array `knownCards`
8787

8888
- Test your code

Cardidy.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31612.314
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cardidy", "src\Dedge.Cardidy\Dedge.Cardidy.csproj", "{826BA1C0-41F1-4183-A7E7-67DF7FC9A843}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cardidy", "src\DEdge.Cardidy\DEdge.Cardidy.csproj", "{826BA1C0-41F1-4183-A7E7-67DF7FC9A843}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "src\Tests\Tests.csproj", "{855909CC-D532-43F5-8457-969C38F578E4}"
99
EndProject

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
<p align="center">
88
<a href="https://github.com/d-edge/Cardidy/actions" title="actions"><img src="https://github.com/d-edge/cardidy/actions/workflows/build.yml/badge.svg?branch=main" alt="actions build" /></a>
9-
<a href="https://www.nuget.org/packages/Dedge.Cardidy/" title="nuget"><img src="https://img.shields.io/nuget/vpre/Dedge.Cardidy" alt="version" /></a>
10-
<!--<a href="https://www.nuget.org/stats/packages/Dedge.Cardidy?groupby=Version" title="stats"><img src="https://img.shields.io/nuget/dt/Dedge.Cardidy" alt="download" /></a>-->
9+
<a href="https://www.nuget.org/packages/DEdge.Cardidy/" title="nuget"><img src="https://img.shields.io/nuget/vpre/DEdge.Cardidy" alt="version" /></a>
10+
<!--<a href="https://www.nuget.org/stats/packages/DEdge.Cardidy?groupby=Version" title="stats"><img src="https://img.shields.io/nuget/dt/DEdge.Cardidy" alt="download" /></a>-->
1111
<a href="https://raw.githubusercontent.com/d-edge/cardidy/main/LICENSE" title="license"><img src="https://img.shields.io/github/license/d-edge/Cardidy" alt="license" /></a>
1212
</p>
1313

@@ -34,18 +34,18 @@ Cardidy is a .net library to identify credit card number and cvv. Maintained by
3434

3535
## Getting Started
3636

37-
Install the [Dedge.Cardidy](https://www.nuget.org/packages/Dedge.Cardidy) NuGet package:
37+
Install the [DEdge.Cardidy](https://www.nuget.org/packages/DEdge.Cardidy) NuGet package:
3838

39-
PM> Install-Package Dedge.Cardidy
39+
PM> Install-Package DEdge.Cardidy
4040

4141
Alternatively you can also use the .NET CLI to add the packages:
4242

43-
dotnet add package Dedge.Cardidy
43+
dotnet add package DEdge.Cardidy
4444

45-
Next create a .net application and use Dedge.Cardidy:
45+
Next create a .net application and use DEdge.Cardidy:
4646

4747
```csharp
48-
var card = Dedge.Cardidy.Identify("4127540509730813").Single();
48+
var card = DEdge.Cardidy.Identify("4127540509730813").Single();
4949
Console.WriteLine(card); // print Visa
5050
```
5151

@@ -56,7 +56,7 @@ open System
5656
5757
[<EntryPoint>]
5858
let main _ =
59-
let isVisa = Dedge.Cardidy.Identify "4127540509730813" |> Seq.head = Dedge.CardType.Visa
59+
let isVisa = DEdge.Cardidy.Identify "4127540509730813" |> Seq.head = DEdge.CardType.Visa
6060
printfn "%b" isVisa
6161
0
6262
```

src/App/App.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

10-
<ItemGroup>
11-
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
12-
<PackageReference Include="Dedge.Cardidy" Version="0.1.0-beta" />
10+
<ItemGroup>
11+
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
12+
<PackageReference Include="DEdge.Cardidy" Version="0.1.0-beta" />
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<ProjectReference Include="..\Dedge.Cardidy\Dedge.Cardidy.csproj" />
16+
<ProjectReference Include="..\DEdge.Cardidy\DEdge.Cardidy.csproj" />
1717
<ProjectReference Include="..\Tests\Tests.csproj" />
1818
</ItemGroup>
1919

src/App/BenchmarkCardidy.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using BenchmarkDotNet.Attributes;
2-
using Dedge;
2+
using DEdge;
33

44
namespace App
55
{

src/App/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using App;
22
using BenchmarkDotNet.Running;
3-
using Dedge;
3+
using DEdge;
44

55
Console.WriteLine(Cardidy.Identify("4127540509730813").Single());
66
var summary = BenchmarkRunner.Run<BenchmarkCardidy>();

src/AppFs/AppFs.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<ProjectReference Include="..\Dedge.Cardidy\Dedge.Cardidy.csproj" />
13+
<ProjectReference Include="..\DEdge.Cardidy\DEdge.Cardidy.csproj" />
1414
</ItemGroup>
1515

1616
</Project>

src/AppFs/Program.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[<EntryPoint>]
22
let main _ =
33
let card = "4127540509730813"
4-
let isVisa = Dedge.Cardidy.Identify card |> Seq.head = Dedge.CardType.Visa
4+
let isVisa = DEdge.Cardidy.Identify card |> Seq.head = DEdge.CardType.Visa
55
printfn "Is %s a visa: %b" card isVisa
66
0

src/Dedge.Cardidy/CardType.cs renamed to src/DEdge.Cardidy/CardType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Dedge;
1+
namespace DEdge;
22

33
/// <summary>
44
/// Current supported CardType

src/Dedge.Cardidy/Cardidy.cs renamed to src/DEdge.Cardidy/Cardidy.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using Dedge.Model;
1+
using DEdge.Model;
22
using System.Collections.Generic;
33
using System.Linq;
44

5-
namespace Dedge;
5+
namespace DEdge;
66

77
/// <summary>
88
/// Validate or identify card number and cvv with Cardidy

src/Dedge.Cardidy/Dedge.Cardidy.csproj renamed to src/DEdge.Cardidy/DEdge.Cardidy.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<!-- General -->
5-
<AssemblyName>Dedge.Cardidy</AssemblyName>
5+
<AssemblyName>DEdge.Cardidy</AssemblyName>
66
<Description>A .net library to identify card number and cvv</Description>
77
<Copyright>Copyright 2021 D-EDGE</Copyright>
88
<Authors>D-EDGE and contributors</Authors>
@@ -19,8 +19,8 @@
1919
<IncludeSymbols>true</IncludeSymbols>
2020

2121
<!-- NuGet settings -->
22-
<PackageId>Dedge.Cardidy</PackageId>
23-
<PackageTags>Dedge;Cardidy;Credit;Payment;Card;Number;Visa;Cvv;Identify;Validate;Detection;</PackageTags>
22+
<PackageId>DEdge.Cardidy</PackageId>
23+
<PackageTags>DEdge;Cardidy;Credit;Payment;Card;Number;Visa;Cvv;Identify;Validate;Detection;</PackageTags>
2424
<PackageReleaseNotes>https://raw.githubusercontent.com/d-edge/cardidy/main/RELEASE_NOTES.md</PackageReleaseNotes>
2525
<PackageProjectUrl>https://github.com/d-edge/cardidy</PackageProjectUrl>
2626
<PackageLicenseExpression>MIT</PackageLicenseExpression>

src/Dedge.Cardidy/Extensions.cs renamed to src/DEdge.Cardidy/Extensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44

5-
namespace Dedge;
5+
namespace DEdge;
66

77
internal static class Extensions
88
{

src/Dedge.Cardidy/Model/ACard.cs renamed to src/DEdge.Cardidy/Model/ACard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Collections.Generic;
22
using System.Linq;
33

4-
namespace Dedge.Model;
4+
namespace DEdge.Model;
55

66
internal abstract record ACard : ICard
77
{

src/Dedge.Cardidy/Model/ALuhnCard.cs renamed to src/DEdge.Cardidy/Model/ALuhnCard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Collections.Generic;
22
using System.Linq;
33

4-
namespace Dedge.Model;
4+
namespace DEdge.Model;
55

66
internal abstract record ALuhnCard : ACard
77
{

src/Dedge.Cardidy/Model/ASixteenCard.cs renamed to src/DEdge.Cardidy/Model/ASixteenCard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Dedge.Model;
1+
namespace DEdge.Model;
22

33
// OOP-afficionados, is this worthwile?
44
internal abstract record ASixteenCard : ACard

src/Dedge.Cardidy/Model/Cards.cs renamed to src/DEdge.Cardidy/Model/Cards.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Dedge.Model;
1+
namespace DEdge.Model;
22

33
// Based on https://en.wikipedia.org/wiki/Payment_card_number
44
internal record AmericanExpress : ALuhnCard

src/Dedge.Cardidy/Model/ICard.cs renamed to src/DEdge.Cardidy/Model/ICard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections.Generic;
22

3-
namespace Dedge.Model;
3+
namespace DEdge.Model;
44

55
internal interface ICard
66
{

src/Dedge.Cardidy/Model/PaddedRange.cs renamed to src/DEdge.Cardidy/Model/PaddedRange.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Dedge.Model;
1+
namespace DEdge.Model;
22

33
internal record PaddedRange
44
{

src/Tests/CvvTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Dedge;
1+
using DEdge;
22
using NUnit.Framework;
33

44
namespace Tests;

src/Tests/IdentifyTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Dedge;
1+
using DEdge;
22
using NUnit.Framework;
33
using System.Collections.Generic;
44
using System.Linq;

src/Tests/OptionTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Dedge;
1+
using DEdge;
22
using NUnit.Framework;
33
using System.Collections.Generic;
44

src/Tests/RandomizedTests.cs

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
using Dedge;
1+
using DEdge;
22
using NUnit.Framework;
33
using System.Linq;
44

55
namespace Tests;
66
public class RandomizedTests
77
{
8+
private readonly Cardizer _cardizer = new Cardizer();
9+
810
[Test(ExpectedResult = CardType.AmericanExpress)]
9-
public CardType ShouldIdentifyRandomAmex() => Cardidy.Identify(Cardizer.NextAmex()).First();
11+
public CardType ShouldIdentifyRandomAmex() => Cardidy.Identify(_cardizer.NextAmex()).First();
1012

1113
[Test(ExpectedResult = CardType.Discover)]
12-
public CardType ShouldIdentifyRandomDiscover() => Cardidy.Identify(Cardizer.NextDiscover()).First();
14+
public CardType ShouldIdentifyRandomDiscover() => Cardidy.Identify(_cardizer.NextDiscover()).First();
1315

1416
[Test(ExpectedResult = CardType.Jcb)]
15-
public CardType ShouldIdentifyRandomJcb() => Cardidy.Identify(Cardizer.NextJcb()).First();
17+
public CardType ShouldIdentifyRandomJcb() => Cardidy.Identify(_cardizer.NextJcb()).First();
1618

1719
[Test(ExpectedResult = CardType.MasterCard)]
18-
public CardType ShouldIdentifyRandomMasterCard() => Cardidy.Identify(Cardizer.NextMasterCard()).First();
20+
public CardType ShouldIdentifyRandomMasterCard() => Cardidy.Identify(_cardizer.NextMasterCard()).First();
1921

2022
[Test(ExpectedResult = CardType.Mir)]
21-
public CardType ShouldIdentifyRandomMir() => Cardidy.Identify(Cardizer.NextMir()).First();
23+
public CardType ShouldIdentifyRandomMir() => Cardidy.Identify(_cardizer.NextMir()).First();
2224

2325
[Test(ExpectedResult = CardType.Uatp)]
24-
public CardType ShouldIdentifyRandomUatp() => Cardidy.Identify(Cardizer.NextUatp()).First();
26+
public CardType ShouldIdentifyRandomUatp() => Cardidy.Identify(_cardizer.NextUatp()).First();
2527

2628
[Test(ExpectedResult = CardType.Verve)]
27-
public CardType ShouldIdentifyRandomVerve() => Cardidy.Identify(Cardizer.NextVerve()).First();
29+
public CardType ShouldIdentifyRandomVerve() => Cardidy.Identify(_cardizer.NextVerve()).First();
2830

2931
[Test(ExpectedResult = CardType.Visa)]
30-
public CardType ShouldIdentifyRandomVisa() => Cardidy.Identify(Cardizer.NextVisa()).First();
32+
public CardType ShouldIdentifyRandomVisa() => Cardidy.Identify(_cardizer.NextVisa()).First();
3133
}

src/Tests/Tests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Dedge.Cardizer" Version="0.5.0-alpha" />
12+
<PackageReference Include="DEdge.Cardizer" Version="0.10.0" />
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
1414
<PackageReference Include="NUnit" Version="3.13.2" />
1515
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
1616
<PackageReference Include="coverlet.collector" Version="3.0.3" />
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<ProjectReference Include="..\Dedge.Cardidy\Dedge.Cardidy.csproj" />
20+
<ProjectReference Include="..\DEdge.Cardidy\DEdge.Cardidy.csproj" />
2121
</ItemGroup>
2222

2323
</Project>

0 commit comments

Comments
 (0)