diff --git a/QRCoder/PayloadGenerator.cs b/QRCoder/PayloadGenerator.cs index 48336a73..85d2a49f 100644 --- a/QRCoder/PayloadGenerator.cs +++ b/QRCoder/PayloadGenerator.cs @@ -53,7 +53,8 @@ public enum Authentication { WEP, WPA, - nopass + nopass, + WPA2 } } diff --git a/QRCoderTests/PayloadGeneratorTests.cs b/QRCoderTests/PayloadGeneratorTests.cs index 2e90e3ce..f4ecc05d 100644 --- a/QRCoderTests/PayloadGeneratorTests.cs +++ b/QRCoderTests/PayloadGeneratorTests.cs @@ -317,6 +317,19 @@ public void wifi_should_build_wpa() generator.ToString().ShouldBe($"WIFI:T:WPA;S:MyWiFiSSID;P:7heP4assw0rd;;"); } + [Fact] + [Category("PayloadGenerator/WiFi")] + public void wifi_should_build_wpa2() + { + var ssid = "MyWiFiSSID"; + var password = "7heP4assw0rd"; + var authmode = PayloadGenerator.WiFi.Authentication.WPA2; + var hideSSID = false; + + var generator = new PayloadGenerator.WiFi(ssid, password, authmode, hideSSID); + + generator.ToString().ShouldBe($"WIFI:T:WPA2;S:MyWiFiSSID;P:7heP4assw0rd;;"); + } [Fact] [Category("PayloadGenerator/WiFi")]