Skip to content

Commit 1149515

Browse files
committed
Merge branch 'dev'
2 parents c0f919a + 0d7e6a1 commit 1149515

108 files changed

Lines changed: 1516 additions & 1076 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*.user
77
*.userosscache
88
*.sln.docstates
9+
.vscode/
910

1011
# User-specific files (MonoDevelop/Xamarin Studio)
1112
*.userprefs

cli-linux/build-bits-linux.sh

100644100755
Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
2-
projectList=(
3-
"/src/Services/Catalog/Catalog.API"
4-
"/src/Services/Basket/Basket.API"
5-
"/src/Services/Ordering/Ordering.API"
6-
"/src/Services/Identity/Identity.API"
7-
"/src/Web/WebMVC"
8-
"/src/Web/WebSPA"
9-
"/src/Web/WebStatus
1+
#!/bin/bash
2+
declare -a projectList=(
3+
'../src/Services/Catalog/Catalog.API'
4+
'../src/Services/Basket/Basket.API'
5+
'../src/Services/Ordering/Ordering.API'
6+
'../src/Services/Identity/Identity.API'
7+
'../src/Web/WebMVC'
8+
'../src/Web/WebSPA'
9+
'../src/Web/WebStatus'
1010
)
1111

1212
# Build SPA app
13-
pushd $(pwd)/src/Web/WebSPA
14-
npm rebuild node-sass
15-
npm run build:prod
13+
# pushd $(pwd)../src/Web/WebSPA
14+
# npm run build:prod
1615

1716
for project in "${projectList[@]}"
1817
do
@@ -28,13 +27,13 @@ do
2827
done
2928

3029
# remove old docker images:
31-
#images=$(docker images --filter=reference="eshop/*" -q)
32-
#if [ -n "$images" ]; then
33-
# docker rm $(docker ps -a -q) -f
34-
# echo "Deleting eShop images in local Docker repo"
35-
# echo $images
36-
# docker rmi $(docker images --filter=reference="eshop/*" -q) -f
37-
#fi
30+
images=$(docker images --filter=reference="eshop/*" -q)
31+
if [ -n "$images" ]; then
32+
docker rm $(docker ps -a -q) -f
33+
echo "Deleting eShop images in local Docker repo"
34+
echo $images
35+
docker rmi $(docker images --filter=reference="eshop/*" -q) -f
36+
fi
3837

3938
# No need to build the images, docker build or docker compose will
4039
# do that using the images and containers defined in the docker-compose.yml file.

docker-compose-windows.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '2.1'
22

33
services:
44
basket.api:
5-
image: eshop/basket.api
5+
image: eshop/basket.api-win
66
build:
77
context: ./src/Services/Basket/Basket.API
88
dockerfile: Dockerfile.nanowin
@@ -11,31 +11,31 @@ services:
1111
- identity.api
1212

1313
catalog.api:
14-
image: eshop/catalog.api
14+
image: eshop/catalog.api-win
1515
build:
1616
context: ./src/Services/Catalog/Catalog.API
1717
dockerfile: Dockerfile.nanowin
1818
depends_on:
1919
- sql.data
2020

2121
identity.api:
22-
image: eshop/identity.api
22+
image: eshop/identity.api-win
2323
build:
2424
context: ./src/Services/Identity/Identity.API
2525
dockerfile: Dockerfile.nanowin
2626
depends_on:
2727
- sql.data
2828

2929
ordering.api:
30-
image: eshop/ordering.api
30+
image: eshop/ordering.api-win
3131
build:
3232
context: ./src/Services/Ordering/Ordering.API
3333
dockerfile: Dockerfile.nanowin
3434
depends_on:
3535
- sql.data
3636

3737
webspa:
38-
image: eshop/webspa
38+
image: eshop/webspa-win
3939
build:
4040
context: ./src/Web/WebSPA
4141
dockerfile: Dockerfile.nanowin
@@ -44,7 +44,7 @@ services:
4444
- basket.api
4545

4646
webmvc:
47-
image: eshop/webmvc
47+
image: eshop/webmvc-win
4848
build:
4949
context: ./src/Web/WebMVC
5050
dockerfile: Dockerfile.nanowin
@@ -58,18 +58,18 @@ services:
5858
image: microsoft/mssql-server-windows
5959

6060
basket.data:
61-
image: redis
62-
build:
63-
context: ./_docker/redis
64-
dockerfile: Dockerfile.nanowin
61+
image: eshop/redis-win
62+
# build:
63+
# context: ./_docker/redis
64+
# dockerfile: Dockerfile.nanowin
6565
ports:
6666
- "6379:6379"
6767

6868
rabbitmq:
69-
image: rabbitmq
70-
build:
71-
context: ./_docker/rabbitmq
72-
dockerfile: Dockerfile.nanowin
69+
image: eshop/rabbitmq-win
70+
# build:
71+
# context: ./_docker/rabbitmq
72+
# dockerfile: Dockerfile.nanowin
7373
ports:
7474
- "5672:5672"
7575

docker-compose.ci.build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ services:
66
volumes:
77
- .:/src
88
working_dir: /src
9-
command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && pushd ./../../.. && dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish"
9+
command: /bin/bash -c "dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish"
1010

eShopOnContainers-ServicesAndWebApps.sln

Lines changed: 154 additions & 103 deletions
Large diffs are not rendered by default.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp1.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
9+
<PackageReference Include="xunit" Version="2.2.0" />
10+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
15+
<ProjectReference Include="..\EventBus\EventBus.csproj" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
20+
</ItemGroup>
21+
22+
</Project>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
2+
using System;
3+
using System.Linq;
4+
using Xunit;
5+
6+
namespace EventBus.Tests
7+
{
8+
public class InMemory_SubscriptionManager_Tests
9+
{
10+
[Fact]
11+
public void After_Creation_Should_Be_Empty()
12+
{
13+
var manager = new InMemoryEventBusSubscriptionsManager();
14+
Assert.True(manager.IsEmpty);
15+
}
16+
17+
[Fact]
18+
public void After_One_Event_Subscription_Should_Contain_The_Event()
19+
{
20+
var manager = new InMemoryEventBusSubscriptionsManager();
21+
manager.AddSubscription<TestIntegrationEvent,TestIntegrationEventHandler>(() => new TestIntegrationEventHandler());
22+
Assert.True(manager.HasSubscriptionsForEvent<TestIntegrationEvent>());
23+
}
24+
25+
[Fact]
26+
public void After_All_Subscriptions_Are_Deleted_Event_Should_No_Longer_Exists()
27+
{
28+
var manager = new InMemoryEventBusSubscriptionsManager();
29+
manager.AddSubscription<TestIntegrationEvent, TestIntegrationEventHandler>(() => new TestIntegrationEventHandler());
30+
manager.RemoveSubscription<TestIntegrationEvent, TestIntegrationEventHandler>();
31+
Assert.False(manager.HasSubscriptionsForEvent<TestIntegrationEvent>());
32+
}
33+
34+
[Fact]
35+
public void Deleting_Last_Subscription_Should_Raise_On_Deleted_Event()
36+
{
37+
bool raised = false;
38+
var manager = new InMemoryEventBusSubscriptionsManager();
39+
manager.OnEventRemoved += (o, e) => raised = true;
40+
manager.AddSubscription<TestIntegrationEvent, TestIntegrationEventHandler>(() => new TestIntegrationEventHandler());
41+
manager.RemoveSubscription<TestIntegrationEvent, TestIntegrationEventHandler>();
42+
Assert.True(raised);
43+
}
44+
45+
[Fact]
46+
public void Get_Handlers_For_Event_Should_Return_All_Handlers()
47+
{
48+
var manager = new InMemoryEventBusSubscriptionsManager();
49+
manager.AddSubscription<TestIntegrationEvent, TestIntegrationEventHandler>(() => new TestIntegrationEventHandler());
50+
manager.AddSubscription<TestIntegrationEvent, TestIntegrationOtherEventHandler>(() => new TestIntegrationOtherEventHandler());
51+
var handlers = manager.GetHandlersForEvent<TestIntegrationEvent>();
52+
Assert.Equal(2, handlers.Count());
53+
}
54+
55+
}
56+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Text;
5+
6+
namespace EventBus.Tests
7+
{
8+
public class TestIntegrationEvent : IntegrationEvent
9+
{
10+
}
11+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace EventBus.Tests
8+
{
9+
public class TestIntegrationOtherEventHandler : IIntegrationEventHandler<TestIntegrationEvent>
10+
{
11+
public bool Handled { get; private set; }
12+
13+
public TestIntegrationOtherEventHandler()
14+
{
15+
Handled = false;
16+
}
17+
18+
public async Task Handle(TestIntegrationEvent @event)
19+
{
20+
Handled = true;
21+
}
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace EventBus.Tests
8+
{
9+
public class TestIntegrationEventHandler : IIntegrationEventHandler<TestIntegrationEvent>
10+
{
11+
public bool Handled { get; private set; }
12+
13+
public TestIntegrationEventHandler()
14+
{
15+
Handled = false;
16+
}
17+
18+
public async Task Handle(TestIntegrationEvent @event)
19+
{
20+
Handled = true;
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)