Source

Linq2vk / src / VkontakteAPI / Linq2vk.Tests / ApiTests.fs

namespace Linq2vk.Tests

open System
open NUnit.Framework
open Linq2vk

[<TestFixture>]
type ApiTests() =

    [<Test>]
    member this.SignatureGenerationTest() =
        let query = Query.fromSeq [
                        ("fields", "photo,sex");
                        ("format", "JSON");
                        ("api_id", "1854119");
                        ("method", "getProfiles");
                        ("uids", "100172");
                        ("v", "3.0");
                    ]
        let apiHandle = Api.create 0L 100172L "655df68ded" "somesid" 0L
        let actual = Api.HelperFunctions.createSignature apiHandle query
        let expected = "4a5bf45c9fe5c66d3afa73d8520fe46a"
        Assert.AreEqual(expected, actual)