diff options
author | Stephen Jennings <Stephen.G.Jennings@gmail.com> | 2011-10-19 20:10:05 -0700 |
---|---|---|
committer | Stephen Jennings <Stephen.G.Jennings@gmail.com> | 2011-10-19 20:10:05 -0700 |
commit | a634dc86118d50465a99239d27e34149e0bd1a7c (patch) | |
tree | 1504906472bc6cd2ebf4a7deff6c28d5cddb209a /OATH.Net.Test | |
parent | e083a02c4c3e6afe79792c24d2f86a9e46afd753 (diff) | |
download | OATH.Net-a634dc86118d50465a99239d27e34149e0bd1a7c.zip OATH.Net-a634dc86118d50465a99239d27e34149e0bd1a7c.tar.gz OATH.Net-a634dc86118d50465a99239d27e34149e0bd1a7c.tar.bz2 |
Rename generator classes.
Diffstat (limited to 'OATH.Net.Test')
-rw-r--r-- | OATH.Net.Test/CounterBasedOtpGeneratorTests.cs (renamed from OATH.Net.Test/CounterBasedOtpTests.cs) | 18 | ||||
-rw-r--r-- | OATH.Net.Test/OATH.Net.Test.csproj | 4 | ||||
-rw-r--r-- | OATH.Net.Test/TimeBasedOtpGeneratorTests.cs (renamed from OATH.Net.Test/TimeBasedOtpTests.cs) | 21 |
3 files changed, 21 insertions, 22 deletions
diff --git a/OATH.Net.Test/CounterBasedOtpTests.cs b/OATH.Net.Test/CounterBasedOtpGeneratorTests.cs index 9b65ea1..3ce6872 100644 --- a/OATH.Net.Test/CounterBasedOtpTests.cs +++ b/OATH.Net.Test/CounterBasedOtpGeneratorTests.cs @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------------ -// <copyright file="CounterBasedOtpTests.cs" company="Stephen Jennings"> +// <copyright file="CounterBasedOtpGeneratorTests.cs" company="Stephen Jennings"> // Copyright 2011 Stephen Jennings. Licensed under the Apache License, Version 2.0. // </copyright> //------------------------------------------------------------------------------------ @@ -13,10 +13,10 @@ namespace OathNet.Test using NUnit.Framework; using OathNet; - public class CounterBasedOtpTests + public class CounterBasedOtpGeneratorTests { [Test] - public void ComputeOtp_returns_reference_values_with_bytearray_key() + public void GenerateOtp_returns_reference_values_with_bytearray_key() { var key = new byte[] { @@ -37,7 +37,7 @@ namespace OathNet.Test } [Test] - public void ComputeOtp_returns_reference_values_with_string_key() + public void GenerateOtp_returns_reference_values_with_string_key() { var key = "3132333435363738393031323334353637383930"; @@ -54,7 +54,7 @@ namespace OathNet.Test } [Test] - public void ComputeOtp_test_with_Google_Authenticator_1() + public void GenerateOtp_test_with_Google_Authenticator_1() { var key = "DEADBEEF48656C6C6F21"; // Base-32: 32W3532IMVWGY3ZB @@ -64,15 +64,15 @@ namespace OathNet.Test private void TestAndAssert(byte[] key, int digits, int counter, string expected) { - var otp = new CounterBasedOtp(key, digits); - var result = otp.ComputeOtp(counter); + var otp = new CounterBasedOtpGenerator(key, digits); + var result = otp.GenerateOtp(counter); Assert.AreEqual(expected, result); } private void TestAndAssert(string key, int digits, int counter, string expected) { - var otp = new CounterBasedOtp(key, digits); - var result = otp.ComputeOtp(counter); + var otp = new CounterBasedOtpGenerator(key, digits); + var result = otp.GenerateOtp(counter); Assert.AreEqual(expected, result); } } diff --git a/OATH.Net.Test/OATH.Net.Test.csproj b/OATH.Net.Test/OATH.Net.Test.csproj index 8124ae1..21ad6c1 100644 --- a/OATH.Net.Test/OATH.Net.Test.csproj +++ b/OATH.Net.Test/OATH.Net.Test.csproj @@ -53,9 +53,9 @@ </ItemGroup> <ItemGroup> <Compile Include="MiscExtensionsTests.cs" /> - <Compile Include="CounterBasedOtpTests.cs" /> + <Compile Include="CounterBasedOtpGeneratorTests.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="TimeBasedOtpTests.cs" /> + <Compile Include="TimeBasedOtpGeneratorTests.cs" /> </ItemGroup> <ItemGroup> <None Include="packages.config" /> diff --git a/OATH.Net.Test/TimeBasedOtpTests.cs b/OATH.Net.Test/TimeBasedOtpGeneratorTests.cs index c4433c7..57d5127 100644 --- a/OATH.Net.Test/TimeBasedOtpTests.cs +++ b/OATH.Net.Test/TimeBasedOtpGeneratorTests.cs @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------------ -// <copyright file="TimeBasedOtpTests.cs" company="Stephen Jennings"> +// <copyright file="TimeBasedOtpGeneratorTests.cs" company="Stephen Jennings"> // Copyright 2011 Stephen Jennings. Licensed under the Apache License, Version 2.0. // </copyright> //------------------------------------------------------------------------------------ @@ -13,10 +13,10 @@ namespace OathNet.Test using NUnit.Framework; using OathNet; - public class TimeBasedOtpTests + public class TimeBasedOtpGeneratorTests { [Test] - public void ComputeOtp_returns_reference_results_with_bytearray_key() + public void GenerateOtp_returns_reference_results_with_bytearray_key() { var key = new byte[] { @@ -33,7 +33,7 @@ namespace OathNet.Test } [Test] - public void ComputeOtp_returns_reference_results_with_string_key() + public void GenerateOtp_returns_reference_results_with_string_key() { var key = "3132333435363738393031323334353637383930"; @@ -45,9 +45,8 @@ namespace OathNet.Test this.TestAndAssert(key, 8, new DateTime(2603, 10, 11, 11, 33, 20, DateTimeKind.Utc), "65353130"); } - [Test] - public void ComputeOtp_test_with_Google_Authenticator_1() + public void GenerateOtp_test_with_Google_Authenticator_1() { var key = "48656C6C6F21DEADBEEF"; // Base-32: JBSWY3DPEHPK3PXP @@ -55,7 +54,7 @@ namespace OathNet.Test } [Test] - public void ComputeOtp_test_with_Google_Authenticator_2() + public void GenerateOtp_test_with_Google_Authenticator_2() { var key = "DEADBEEF48656C6C6F21"; // Base-32: 32W3532IMVWGY3ZB @@ -64,15 +63,15 @@ namespace OathNet.Test private void TestAndAssert(byte[] key, int digits, DateTime time, string expected) { - var otp = new TimeBasedOtp(key, digits); - var result = otp.ComputeOtp(time); + var otp = new TimeBasedOtpGenerator(key, digits); + var result = otp.GenerateOtp(time); Assert.AreEqual(expected, result); } private void TestAndAssert(string key, int digits, DateTime time, string expected) { - var otp = new TimeBasedOtp(key, digits); - var result = otp.ComputeOtp(time); + var otp = new TimeBasedOtpGenerator(key, digits); + var result = otp.GenerateOtp(time); Assert.AreEqual(expected, result); } } |