diff --git a/Thirdweb.Tests/Thirdweb.Utils.Tests.cs b/Thirdweb.Tests/Thirdweb.Utils.Tests.cs index edf3c3e..1eb7b51 100644 --- a/Thirdweb.Tests/Thirdweb.Utils.Tests.cs +++ b/Thirdweb.Tests/Thirdweb.Utils.Tests.cs @@ -223,6 +223,27 @@ public void GenerateSIWE_ReturnsCorrectValue() Assert.Equal(expectedSIWE, siwe); } + [Fact] + public void GenerateSIWE_WithResources_ReturnsCorrectValue() + { + var loginPayloadData = new LoginPayloadData + { + Version = "1", + ChainId = "421614", + Nonce = "0", + Address = Constants.ADDRESS_ZERO, + Domain = "thirdweb.com", + IssuedAt = "0", + ExpirationTime = "0", + InvalidBefore = "0", + Resources = new List() { "resource1", "resource2" } + }; + var expectedSIWE = + "thirdweb.com wants you to sign in with your Ethereum account:\n0x0000000000000000000000000000000000000000\n\n\nVersion: 1\nChain ID: 421614\nNonce: 0\nIssued At: 0\nExpiration Time: 0\nNot Before: 0\nResources:\n- resource1\n- resource2"; + var siwe = Utils.GenerateSIWE(loginPayloadData); + Assert.Equal(expectedSIWE, siwe); + } + [Fact] public void GenerateSIWE_ThrowsOnNullLoginPayloadData() {