Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
belidzs committed Feb 15, 2020
2 parents 0f47dd7 + dd9990b commit 2338d01
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 67 deletions.
37 changes: 37 additions & 0 deletions HungarianBankAccount.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HungarianBankAccount", "HungarianBankAccount\HungarianBankAccount.csproj", "{B9F68734-9EFE-4B17-9B46-5C2EFA269E7A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HungarianBankAccountTests", "HungarianBankAccountTests\HungarianBankAccountTests.csproj", "{0BC9151E-30A6-46C7-A424-AA876252ADC8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HungarianBankAccountExamples", "HungarianBankAccountExamples\HungarianBankAccountExamples.csproj", "{D57E73DD-8593-403D-BA1A-008ACF3234E2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B9F68734-9EFE-4B17-9B46-5C2EFA269E7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9F68734-9EFE-4B17-9B46-5C2EFA269E7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9F68734-9EFE-4B17-9B46-5C2EFA269E7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9F68734-9EFE-4B17-9B46-5C2EFA269E7A}.Release|Any CPU.Build.0 = Release|Any CPU
{0BC9151E-30A6-46C7-A424-AA876252ADC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BC9151E-30A6-46C7-A424-AA876252ADC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BC9151E-30A6-46C7-A424-AA876252ADC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0BC9151E-30A6-46C7-A424-AA876252ADC8}.Release|Any CPU.Build.0 = Release|Any CPU
{D57E73DD-8593-403D-BA1A-008ACF3234E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D57E73DD-8593-403D-BA1A-008ACF3234E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D57E73DD-8593-403D-BA1A-008ACF3234E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D57E73DD-8593-403D-BA1A-008ACF3234E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {08383AAC-75CE-4F15-B676-B226BBA31A41}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;

namespace MagyarNemzetiBank
namespace HungarianBankAccount
{
/// <summary>
/// Represents a single Hungarian Bank Account.
Expand Down Expand Up @@ -98,7 +98,7 @@ public BankAccount(string accountNumber)
/// <summary>
/// Tells whether the bank account's account number is valid.
/// </summary>
public bool IsValid => BankAccountValidator.Validate(AccountNumber);
public bool IsValid => Validator.Validate(AccountNumber);

/// <summary>
/// Name of the bank the BankAccount belongs to.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0</TargetFrameworks>
<RootNamespace>MagyarNemzetiBank</RootNamespace>
<AssemblyName>MagyarNemzetiBank.BankAccount</AssemblyName>
<Description>This library written in pure C# checks the validity of Hungarian bank account numbers and determines which bank they belong to</Description>
<Copyright>Copyright (c) 2019 Balázs Keresztury</Copyright>
<Product>MagyarNemzetiBank.BankAccount</Product>
<RootNamespace>HungarianBankAccount</RootNamespace>
<AssemblyName>HungarianBankAccount</AssemblyName>
<Description>This library written in C# checks the validity of a Hungarian bank account number (in GIRO format) and determines which bank it belongs to.</Description>
<Copyright>Copyright (c) 2020 Balázs Keresztury</Copyright>
<Product></Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/belidzs/MagyarNemzetiBank.BankAccount</PackageProjectUrl>
<RepositoryUrl>https://github.com/belidzs/MagyarNemzetiBank.BankAccount</RepositoryUrl>
<PackageProjectUrl>https://github.com/belidzs/HungarianBankAccount</PackageProjectUrl>
<RepositoryUrl>https://github.com/belidzs/HungarianBankAccount</RepositoryUrl>
<PackageTags>mnb bank banking bank-account bankaccount giro central-bank hungarian</PackageTags>
<Authors>Balázs Keresztury</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Company />
</PropertyGroup>
<ItemGroup>
<None Remove="stylecop.json" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="BankAccountValidator.cs" company="Balázs Keresztury">
// <copyright file="Validator.cs" company="Balázs Keresztury">
// Copyright (c) Balázs Keresztury. All rights reserved.
// </copyright>

Expand All @@ -17,12 +17,12 @@
using System;
using System.Text.RegularExpressions;

namespace MagyarNemzetiBank
namespace HungarianBankAccount
{
/// <summary>
/// Static class to validate Hungarian bank account numbers.
/// </summary>
public static class BankAccountValidator
public static class Validator
{
private const string RegexGiro = "^[0-9]{8}-?[0-9]{8}(-?[0-9]{8})?$";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<RootNamespace>HungarianBankAccountExamples</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BankAccount\BankAccount.csproj" />
<ProjectReference Include="..\HungarianBankAccount\HungarianBankAccount.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

using System;
using System.Collections.Generic;
using MagyarNemzetiBank;
using HungarianBankAccount;

namespace BankAccountExamples
namespace HungarianBankAccountExamples
{
/// <summary>
/// Main entry point of the application.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

using System;
using System.Collections.Generic;
using HungarianBankAccount;
using NUnit.Framework;

namespace MagyarNemzetiBank.Tests
namespace HungarianBankAccountTests
{
/// <summary>
/// Tests for the BankAccount class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<AssemblyName>HungarianBankAccountTests</AssemblyName>
<RootNamespace>HungarianBankAccountTests</RootNamespace>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
</PropertyGroup>

<ItemGroup>
Expand All @@ -27,7 +32,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BankAccount\BankAccount.csproj" />
<ProjectReference Include="..\HungarianBankAccount\HungarianBankAccount.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// <copyright file="BankAccountValidatorTests.cs" company="Balázs Keresztury">
// <copyright file="ValidatorTests.cs" company="Balázs Keresztury">
// Copyright (c) Balázs Keresztury. All rights reserved.
// </copyright>

using HungarianBankAccount;
using NUnit.Framework;

namespace MagyarNemzetiBank.Tests
namespace HungarianBankAccountTests
{
/// <summary>
/// Tests various valid and invalid account numbers.
/// </summary>
[TestFixture]
public class BankAccountValidatorTests
public class ValidatorTests
{
/// <summary>
/// Tests if valid bank account numbers are recognized.
Expand All @@ -24,7 +25,7 @@ public class BankAccountValidatorTests
[TestCase("10032000-01076349")]
public void TestValid(string accountNumber)
{
Assert.That(BankAccountValidator.Validate(accountNumber), Is.True);
Assert.That(Validator.Validate(accountNumber), Is.True);
}

/// <summary>
Expand All @@ -39,7 +40,7 @@ public void TestValid(string accountNumber)
[TestCase("10032000-01076348")]
public void TestBadChecksum(string accountNumber)
{
Assert.That(BankAccountValidator.Validate(accountNumber), Is.False);
Assert.That(Validator.Validate(accountNumber), Is.False);
}

/// <summary>
Expand All @@ -56,7 +57,7 @@ public void TestBadChecksum(string accountNumber)
[TestCase("10032000-0107634a")]
public void TestBadFormat(string accountNumber)
{
Assert.That(BankAccountValidator.Validate(accountNumber), Is.False);
Assert.That(Validator.Validate(accountNumber), Is.False);
}
}
}
File renamed without changes.
37 changes: 0 additions & 37 deletions MagyarNemzetiBank.BankAccount.sln

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MagyarNemzetiBank.BankAccount
This library written in pure C# checks the validity of a Hungarian bank account number and determines which bank is belongs to.
# HungarianBankAccount
This library written in C# checks the validity of a Hungarian bank account number (in GIRO format) and determines which bank it belongs to.

## Usage
Let's check a valid bank account:
Expand Down Expand Up @@ -42,7 +42,7 @@ catch (KeyNotFoundException)
}
```

Alternatively you can use the static `BankAccount.Validate(string accountNumber)` method to check if the number is syntactically correct.
Alternatively you can use the static `Validator.Validate(string accountNumber)` method to check if the number is syntactically and mathematically correct.

## Download from Nuget
[!['nuget badge'](https://img.shields.io/nuget/v/MagyarNemzetiBank.BankAccount.svg)](https://www.nuget.org/packages/MagyarNemzetiBank.BankAccount/)
[!['nuget badge'](https://img.shields.io/nuget/v/HungarianBankAccount.svg)](https://www.nuget.org/packages/HungarianBankAccount/)

0 comments on commit 2338d01

Please sign in to comment.