コード例 #1
0
            public void then_should_not_have_any_arguements()
            {
                // given
                var database = new DatabaseStub();

                // when
                database.ExecuteStoredProcedure("MySpName");

                // then
                Sql executedSql = database.ExecuteSql;
                executedSql.Arguments.ShouldBeEmpty();
            }
コード例 #2
0
            public void then_should_not_have_any_arguements()
            {
                // given
                var database = new DatabaseStub();

                // when
                database.ExecuteStoredProcedure("MySpName");

                // then
                Sql executedSql = database.ExecuteSql;

                executedSql.Arguments.ShouldBeEmpty();
            }
コード例 #3
0
            public void then_should_call_sp_with_sp_name()
            {
                // given
                var database = new DatabaseStub();

                // when
                database.ExecuteStoredProcedure("MySpName");

                // then
                Sql executedSql = database.ExecuteSql;
                executedSql.SQL.ShouldContain("EXEC");
                executedSql.SQL.ShouldContain("MySpName");
            }
コード例 #4
0
            public void then_should_call_sp_with_sp_name()
            {
                // given
                var database = new DatabaseStub();

                // when
                database.ExecuteStoredProcedure("MySpName");

                // then
                Sql executedSql = database.ExecuteSql;

                executedSql.SQL.ShouldContain("EXEC");
                executedSql.SQL.ShouldContain("MySpName");
            }
コード例 #5
0
            public void then_should_include_paramter_in_sql()
            {
                // given
                var database = new DatabaseStub();

                // when
                database.ExecuteStoredProcedure("MySpName", new Parameter("Param1", "Value"));

                // then
                Sql executedSql = database.ExecuteSql;
                executedSql.Arguments.ShouldNotBeEmpty();
                executedSql.Arguments.Any(x => x.Equals("Value")).ShouldBeTrue();

                executedSql.SQL.ShouldContain("Param1");
            }
コード例 #6
0
            public void then_should_include_paramter_in_sql()
            {
                // given
                var database = new DatabaseStub();

                // when
                database.ExecuteStoredProcedure("MySpName", new Parameter("Param1", "Value"));

                // then
                Sql executedSql = database.ExecuteSql;

                executedSql.Arguments.ShouldNotBeEmpty();
                executedSql.Arguments.Any(x => x.Equals("Value")).ShouldBeTrue();

                executedSql.SQL.ShouldContain("Param1");
            }