Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstropek committed Dec 5, 2016
1 parent 26c8a94 commit d2bdbce
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Shop.Client/build-test.sh

This file was deleted.

2 changes: 1 addition & 1 deletion Shop.Client/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class AppComponent {
public products: any[];

constructor(private http: Http) {
http.get("http://technical-summit-dev.azurewebsites.net/api/products")
http.get("http://techsummit-api.azurewebsites.net/api/products")
.forEach(resp => {
this.products = resp.json();
});
Expand Down
6 changes: 6 additions & 0 deletions Shop.WebApi/Controllers/OrdersController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Shop.WebApi.DataAccess;
using Shop.WebApi.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
Expand Down Expand Up @@ -32,6 +33,11 @@ public async Task<IHttpActionResult> AddOrder([FromBody] IEnumerable<OrderInput>
return this.BadRequest("Order must consist of >= 1 and <= 10 items.");
}

if (orderLines.Any(ol => ol.ProductId == 4711))
{
throw new DivideByZeroException();
}

return Created("dummy", await this.OrderTable.AddOrderLinesAsync(orderLines));
}
}
Expand Down
7 changes: 5 additions & 2 deletions Shop.WebApiLoadTest/QueryProductsAndAddOrder.webtest
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="QueryProductsAndAddOrder" Id="b023b133-7c79-4b9d-aa29-0341837088b8" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="GET" Guid="53ddf8dd-155b-47ad-871c-e687d2c7c43b" Version="1.1" Url="http://technical-summit-dev.azurewebsites.net/api/products/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="False" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
<Request Method="POST" Guid="cad6a212-5df7-42a0-8e0b-368b6940937a" Version="1.1" Url="http://technical-summit-dev.azurewebsites.net/api/orders/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="False" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="201" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Request Method="GET" Guid="53ddf8dd-155b-47ad-871c-e687d2c7c43b" Version="1.1" Url="{{AzureAppService}}/api/products/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="False" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
<Request Method="POST" Guid="cad6a212-5df7-42a0-8e0b-368b6940937a" Version="1.1" Url="{{AzureAppService}}/api/orders/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="False" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="201" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<StringHttpBody ContentType="application/json" InsertByteOrderMark="False">WwB7AA0ACgAKACAAIAAgACAAIgBQAHIAbwBkAHUAYwB0AEkAZAAiADoAIAAxACwACgANAAoAIAAgACAAIAAiAEEAbQBvAHUAbgB0ACIAOgAgADEAMAAgACAADQAKAH0AXQA=</StringHttpBody>
</Request>
</Items>
<ContextParameters>
<ContextParameter Name="AzureAppService" Value="http://techsummit-api.azurewebsites.net" />
</ContextParameters>
</WebTest>

0 comments on commit d2bdbce

Please sign in to comment.