diff --git a/exercises/diffie-hellman/DiffieHellmanTest.cs b/exercises/diffie-hellman/DiffieHellmanTest.cs index 2f96a8f8fe..3cb9ca503c 100644 --- a/exercises/diffie-hellman/DiffieHellmanTest.cs +++ b/exercises/diffie-hellman/DiffieHellmanTest.cs @@ -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); } } \ No newline at end of file diff --git a/generators/Exercises/Generators/DiffieHellman.cs b/generators/Exercises/Generators/DiffieHellman.cs index 8e5d52e2af..12b73eebc4 100644 --- a/generators/Exercises/Generators/DiffieHellman.cs +++ b/generators/Exercises/Generators/DiffieHellman.cs @@ -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; @@ -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; }