示例#1
0
        public async Task GetUser_MatchEmailAddress_ReturnNames()
        {
            await TestRunner.ExecuteStoredProcedureNonQueryAsync("dbo.AddUser",
                                                                 new SqlQueryParameter("FirstName", "Jamie"),
                                                                 new SqlQueryParameter("LastName", "Burns"),
                                                                 new SqlQueryParameter("EmailAddress", "*****@*****.**"),
                                                                 new SqlQueryParameter("StartDate", DateTime.Parse("01-Mar-2020")),
                                                                 new SqlQueryParameter("NumberOfHats", 14),
                                                                 new SqlQueryParameter("Cost", 15.87));

            QueryResult result = await TestRunner.ExecuteStoredProcedureQueryAsync("dbo.GetUser", new SqlQueryParameter("EmailAddress", "*****@*****.**"));

            result
            .AssertRowCount(1)
            .AssertColumnsExist("FirstName", "LastName")
            .AssertRowValues(0, new DataSetRow
            {
                { "FirstName", "Jamie" },
                { "LastName", "Burns" }
            })
            .ValidateRow(0)
            .AssertValue("FirstName", Comparisons.IsType(typeof(string)));
        }