From defde0e4cb9854d6142f00866f2bd1fbe803ef20 Mon Sep 17 00:00:00 2001 From: Shane32 Date: Sat, 13 Apr 2024 11:10:16 -0400 Subject: [PATCH 1/2] Add support for WPA2 --- QRCoder/PayloadGenerator.cs | 3 ++- QRCoderTests/PayloadGeneratorTests.cs | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/QRCoder/PayloadGenerator.cs b/QRCoder/PayloadGenerator.cs index 6275e5be..8137d7f3 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 f4406bb7..2527f2d8 100644 --- a/QRCoderTests/PayloadGeneratorTests.cs +++ b/QRCoderTests/PayloadGeneratorTests.cs @@ -317,6 +317,20 @@ 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")] From f74e547d98d50aba4328f1f22ef35f7a2ba120ac Mon Sep 17 00:00:00 2001 From: Shane32 Date: Sat, 13 Apr 2024 11:11:20 -0400 Subject: [PATCH 2/2] Update --- QRCoderTests/PayloadGeneratorTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/QRCoderTests/PayloadGeneratorTests.cs b/QRCoderTests/PayloadGeneratorTests.cs index 2527f2d8..8a9a2c72 100644 --- a/QRCoderTests/PayloadGeneratorTests.cs +++ b/QRCoderTests/PayloadGeneratorTests.cs @@ -331,7 +331,6 @@ public void wifi_should_build_wpa2() generator.ToString().ShouldBe($"WIFI:T:WPA2;S:MyWiFiSSID;P:7heP4assw0rd;;"); } - [Fact] [Category("PayloadGenerator/WiFi")] public void wifi_should_ignore_hiddenSSID_param()