If you like to run the demo sites from Visual Studio, do the followings:
For Step One:
-
Build the solution
-
When there is no build error, press F5 to run the solution. The home page should appear in the browser
-
Go to Fiddler and do a request for the service as below: Request URL: http://localhost:27387/api/getprice/Original Request Method: POST Request Header: Content-Type: application/json; charset=utf-8 Request Body: {"Items":[{"BarCodeId":"111"},{"BarCodeId":"222"}]}
*BarCodeId 111 referenced to Apple Barcode *BarCodeId 222 referenced to Orange Barcode
-
The Output will look like below in the response body: TotalPrice=0.85
-
As Example of this step , fiddler session "StepOneSession.saz" is attached under: ~\CheckoutSystem\Fiddler
If you like to test the demo from Visual Studio, do the followings:
For Step One: Test One:
- Go to ~\CheckOutSystem\Domain.Services.Test\GetPrice\PriceCalculationTest.cs
- Run the Test Method GetPrice()
Test Two:
- Press F5 to start the home page
- Go to ~\CheckOutSystem\CheckOutSystem.Tests\Controllers\GetPrice\GetPriceControllerTest.cs
- Run the Test Method GetPrice()
For Step Two:
-
Build the solution
-
When there is no build error, press F5 to run the solution. The home page should appear in the browser
-
Go to Fiddler and do a request for the service as below: Request URL: http://localhost:27387/api/getprice/Offer Request Method: POST Request Header: Content-Type: application/json; charset=utf-8 Request Body: {"Items":[ {"BarCodeId":"111"},{"BarCodeId":"222"},{"BarCodeId":"222"}, {"BarCodeId":"111"},{"BarCodeId":"111"}, {"BarCodeId":"111"},{"BarCodeId":"111"},{"BarCodeId":"222"},{"BarCodeId":"222"}]}
*BarCodeId 111 referenced to Apple Barcode *BarCodeId 222 referenced to Orange Barcode
Offers: *Buy one, get one free on Apples *3 for the price of 2 on Oranges
-
The Output will look like below in the response body: TotalPrice=2.3
-
As Example of this step , fiddler session "StepTwoSession.saz" is attached under: ~\CheckoutSystem\Fiddler
If you like to test the demo from Visual Studio, do the followings:
For Step One: Test One:
- Go to ~\CheckOutSystem\Domain.Services.Test\GetPrice\PriceCalculationTest.cs
- Run the Test Method GetPriceWithOffer()
Test Two:
- Press F5 to start the home page
- Go to ~\CheckOutSystem\CheckOutSystem.Tests\Controllers\GetPrice\GetPriceControllerTest.cs
- Run the Test Method GetPriceWithOffer()