Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion QRCoder/PayloadGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public enum Authentication
{
WEP,
WPA,
nopass
nopass,
WPA2
}
}

Expand Down
13 changes: 13 additions & 0 deletions QRCoderTests/PayloadGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down