上QQ阅读APP看书,第一时间看更新
Testing the application
In order to test the application for the two described scenarios (orders retrieval and order creation), our console application must receive the correct defined parameter (READ
, CREATE
) at startup.
Let's learn how to test the application by performing the following steps:
- To do so, right-click on the solution name, click Properties, and then choose Debug. In the Debug window, you can specify the startup parameters:
- Let's test the application by passing the
READ
parameter as input. - The application code has to retrieve all the sales orders for
Customer No. = 10000
(Cannon Group SpA
) and this is the situation that we have on NAV: - If you place a breakpoint (by pressing F9) after the lines that calls the NAV web service, you can see the retrieved records in the Debug window:
- The final output on the console shows you the details for all the retrieved sales orders:
- Now change the application startup parameter and use
CREATE
in order to call the function for creating a sales order on NAV: - We placed a breakpoint after the first NAV web service
Create
call to check the correct order initialization (NAV must give us theOrder No.
). While debugging (Visual Studio stops the execution at your breakpoint) select theorder
object on the code, right-click, and choose QuickWatch…. - In the QuickWatch window in Visual Studio, you can see all the object details and you can check the
Order No.
returned by NAV: - This is the final result on NAV: