Browse Source

Tests fixed

pull/65/head
Sebastian Stehle 9 years ago
parent
commit
096f85716e
  1. 7
      Dockerfile
  2. 15
      Dockerfile.test
  3. 13
      tests/Squidex.Infrastructure.Tests/Assets/FolderAssetStoreTests.cs

7
Dockerfile

@ -46,9 +46,10 @@ RUN cp -a /tmp/node_modules /src/Squidex/ \
# Test Backend # Test Backend
RUN dotnet restore \ RUN dotnet restore \
&& dotnet test tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj \ && dotnet test tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj \
&& dotnet test tests/Squidex.Core.Tests/Squidex.Core.Tests.csproj \ && dotnet test tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj \
&& dotnet test tests/Squidex.Read.Tests/Squidex.Read.Tests.csproj \ && dotnet test tests/Squidex.Domain.Apps.Read.Tests/Squidex.Domain.Apps.Read.Tests.csproj \
&& dotnet test tests/Squidex.Write.Tests/Squidex.Write.Tests.csproj && dotnet test tests/Squidex.Domain.Apps.Write.Tests/Squidex.Domain.Apps.Write.Tests.csproj \
&& dotnet test tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj
# Publish # Publish
RUN dotnet publish src/Squidex/Squidex.csproj --output /out/ --configuration Release RUN dotnet publish src/Squidex/Squidex.csproj --output /out/ --configuration Release

15
Dockerfile.test

@ -0,0 +1,15 @@
FROM microsoft/aspnetcore-build:1.1.2
COPY . .
WORKDIR /
# Test Backend
RUN dotnet restore \
&& dotnet test tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj \
&& dotnet test tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj \
&& dotnet test tests/Squidex.Domain.Apps.Read.Tests/Squidex.Domain.Apps.Read.Tests.csproj \
&& dotnet test tests/Squidex.Domain.Apps.Write.Tests/Squidex.Domain.Apps.Write.Tests.csproj \
&& dotnet test tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj
RUN ls /media/

13
tests/Squidex.Infrastructure.Tests/Assets/FolderAssetStoreTests.cs

@ -41,6 +41,12 @@ namespace Squidex.Infrastructure.Assets
Assert.True(Directory.Exists(testFolder)); Assert.True(Directory.Exists(testFolder));
} }
[Fact]
public void Should_throw_when_creating_directory_failed()
{
Assert.Throws<ConfigurationException>(() => new FolderAssetStore(CreateInvalidPath(), new Mock<ISemanticLog>().Object).Connect());
}
[Fact] [Fact]
public Task Should_throw_exception_if_asset_not_found() public Task Should_throw_exception_if_asset_not_found()
{ {
@ -65,5 +71,12 @@ namespace Squidex.Infrastructure.Assets
Assert.Equal(assetData.ToArray(), readData.ToArray()); Assert.Equal(assetData.ToArray(), readData.ToArray());
} }
private static string CreateInvalidPath()
{
var windir = Environment.GetEnvironmentVariable("windir");
return !string.IsNullOrWhiteSpace(windir) ? "Z://invalid" : "/proc/invalid";
}
} }
} }

Loading…
Cancel
Save