コード例 #1
0
    private async Task <HttpResponseMessage> AddScheme(string name, string message)
    {
        var goToSignIn = await Client.GetAsync("/");

        var signIn = await TestAssert.IsHtmlDocumentAsync(goToSignIn);

        var form = TestAssert.HasForm(signIn);

        return(await Client.SendAsync(form, new Dictionary <string, string>()
        {
            ["scheme"] = name,
            ["OptionsMessage"] = message,
        }));
    }
コード例 #2
0
    internal static async Task <HttpResponseMessage> SignIn(HttpClient client, string userName, string dob)
    {
        var goToSignIn = await client.GetAsync("/account/signin");

        var signIn = await TestAssert.IsHtmlDocumentAsync(goToSignIn);

        var form = TestAssert.HasForm(signIn);

        return(await client.SendAsync(form, new Dictionary <string, string>()
        {
            ["UserName"] = userName,
            ["DOB"] = dob,
        }));
    }
コード例 #3
0
    internal async Task SignIn(string userName)
    {
        var goToSignIn = await Client.GetAsync("/account/login");

        var signIn = await TestAssert.IsHtmlDocumentAsync(goToSignIn);

        var form = TestAssert.HasForm(signIn);
        await Client.SendAsync(form, new Dictionary <string, string>()
        {
            ["username"] = userName,
            ["password"] = userName // this test doesn't care what the password is
        });

        Assert.Equal(HttpStatusCode.OK, signIn.StatusCode);
    }