Skip to content

Commit

Permalink
diffie-hellman: fix broken test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Jul 7, 2019
1 parent 342a8ff commit 93cbdad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions exercises/diffie-hellman/DiffieHellmanTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public void Key_exchange()
var g = new BigInteger(5);
var alicePrivateKey = DiffieHellman.PrivateKey(p);
var bobPrivateKey = DiffieHellman.PrivateKey(p);
var alicePublicKey = DiffieHellman.PublicKey(p,G,AlicePrivateKey);
var bobPublicKey = DiffieHellman.PublicKey(p,G,BobPrivateKey);
var secretA = DiffieHellman.Secret(p,BobPublicKey,AlicePrivateKey);
var secretB = DiffieHellman.Secret(p,AlicePublicKey,BobPrivateKey);
var alicePublicKey = DiffieHellman.PublicKey(p, g, alicePrivateKey);
var bobPublicKey = DiffieHellman.PublicKey(p, g, bobPrivateKey);
var secretA = DiffieHellman.Secret(p, bobPublicKey, alicePrivateKey);
var secretB = DiffieHellman.Secret(p, alicePublicKey, bobPrivateKey);
Assert.Equal(secretA, secretB);
}
}
3 changes: 2 additions & 1 deletion generators/Exercises/Generators/DiffieHellman.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Numerics;
using System.Text;
using Exercism.CSharp.Helpers;
using Exercism.CSharp.Output;
using Exercism.CSharp.Output.Rendering;
using Humanizer;
Expand Down Expand Up @@ -96,7 +97,7 @@ private static dynamic ConvertKeyExchangeInput(dynamic input, TestMethod testMet
case long l:
return new BigInteger(l);
case string str:
return new UnescapedValue($"{testMethod.TestedClass}.{str.Pascalize()}");
return new UnescapedValue($"{testMethod.TestedClass}.{char.ToUpper(str[0]) + str.Substring(1)}");
default:
return input;
}
Expand Down

0 comments on commit 93cbdad

Please sign in to comment.