Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of skills related to VS2005 Code

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly analyzes the relevant knowledge points of the example analysis of VS2005 code related skills, the content is detailed and easy to understand, the operation details are reasonable, and has a certain reference value. If you are interested, you might as well follow the editor to take a look, and follow the editor to learn more about "sample analysis of VS2005 code-related skills".

The VS2005 code and integrated development environment includes many new and improved features to improve productivity. IDE has also been redesigned to provide developers with direct access to .NET Framework components. And the instructions for using the code.

If this logic is stored in a data table, we can pass the price of the order into a stored procedure and then query the discount quantity in the table. However, when we start to create tables and stored procedures, we quickly encounter some problems. What is the structure of this table? How do we represent the maximum and minimum values of a range? How to deal with the boundary situation?

This is the question that DBPro's unit testing feature is trying to answer. Let's look at how to use a test-driven approach to create tables and stored procedures in SQL Server and implement this functionality. If you want to experiment with the following steps, you need to install Visual Studio 2005 Universe 2008 with Team Edition for Database Professionals (DBPro), as well as Team Edition for Testers/Developers.

Content navigation

First of all, we need a database. The tests in DBPro are for a real database. In general, unit testing should avoid involving file systems, databases, and other external resources (Feathers, Michael, Working Effectively with Legacy Code, Prentice Hall PTR, 2004), as this slows down testing. However, you may be able to think of these tests as integration tests, so that the effectiveness of the tests makes up for the speed problem. To speed up the tests, we will run these tests in the local SQL Express database.

When you click the OK button, a configuration wizard pops up and lets us select a database connection to run the test. It also allows us to select a second connection to validate these tests. This is useful in some cases, such as when a test should be performed as a normal user, but the stored procedure may modify a data table that is not accessible to the user's account.

Now we need to select a previously established database connection to perform the unit test, so we select the OnlineStore connection from the drop-down box. Since we will develop our stored procedures in writing the test database project, we will also create configuration information before the test run to automatically deploy our changes to the database project. This causes the test to be delayed before running, but it avoids inexplicably passing or failing the test because there are no changes to redeploy the database.

This is the end of the "sample analysis of VS2005 code-related skills". More related content can be searched for previous articles, hoping to help you answer questions and questions, please support the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report