Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aruss committed Mar 26, 2018
1 parent 7029af3 commit 3f52f44
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/IdentityBase.SendGrid/IdentityBase.SendGrid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceBase.Notification.SendGrid" Version="1.1.19" />
<PackageReference Include="ServiceBase.Notification.SendGrid" Version="1.1.20" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IdentityBase.Shared/IdentityBase.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.2" />
<PackageReference Include="ServiceBase" Version="1.1.19" />
<PackageReference Include="ServiceBase" Version="1.1.20" />
</ItemGroup>

</Project>
27 changes: 20 additions & 7 deletions src/IdentityBase.Shared/ThemeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@ namespace IdentityBase
using System.IO;
using IdentityBase.Configuration;
using IdentityBase.Models;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using ServiceBase.Extensions;

public class ThemeHelper
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ApplicationOptions _applicationOptions;
private readonly IHostingEnvironment _environment;

public ThemeHelper(
ApplicationOptions applicationOptions,
IHttpContextAccessor httpContextAccessor)
IHttpContextAccessor httpContextAccessor,
IHostingEnvironment environment)
{
this._httpContextAccessor = httpContextAccessor;
this._applicationOptions = applicationOptions;
this._environment = environment;
}

// TODO: return theme object instead of string
Expand Down Expand Up @@ -44,12 +48,21 @@ public string GetThemeDirectoryPath()
{
string theme = this.GetTheme();

string path = Path.GetFullPath(
Path.Combine(
this._applicationOptions.ThemeDirectoryPath,
theme));

return path;
if (Path.IsPathRooted(this._applicationOptions.ThemeDirectoryPath))
{
return Path.GetFullPath(
Path.Combine(
this._applicationOptions.ThemeDirectoryPath,
theme));
}
else
{
return Path.GetFullPath(
Path.Combine(
this._environment.ContentRootPath,
this._applicationOptions.ThemeDirectoryPath,
theme));
}
}

public string GetLocalizationDirectoryPath()
Expand Down
2 changes: 1 addition & 1 deletion src/IdentityBase.Smtp/IdentityBase.Smtp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<PackageReference Include="MimeKit" Version="2.0.2" />
<PackageReference Include="ServiceBase.Notification.Smtp" Version="1.1.19" />
<PackageReference Include="ServiceBase.Notification.Smtp" Version="1.1.20" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IdentityBase.Twilio/IdentityBase.Twilio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceBase.Notification.Twilio" Version="1.1.19" />
<PackageReference Include="ServiceBase.Notification.Twilio" Version="1.1.20" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IdentityBase.WebApi/IdentityBase.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.3" />
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
<PackageReference Include="ServiceBase" Version="1.1.19" />
<PackageReference Include="ServiceBase" Version="1.1.20" />
<PackageReference Include="ServiceBase.Mvc" Version="1.1.20" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="2.3.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/IdentityBase/IdentityBase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
<PackageReference Include="Serilog.Settings.Configuration" Version="2.6.1" />
<PackageReference Include="Serilog.Sinks.Literate" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="ServiceBase" Version="1.1.19" />
<PackageReference Include="ServiceBase.Events.RabbitMQ" Version="1.1.19" />
<PackageReference Include="ServiceBase" Version="1.1.20" />
<PackageReference Include="ServiceBase.Events.RabbitMQ" Version="1.1.20" />
<PackageReference Include="ServiceBase.Mvc" Version="1.1.20" />
</ItemGroup>
<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/IdentityBase/IdentityBase.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<dependency id="Serilog.Settings.Configuration" version="2.6.1" exclude="Build,Analyzers" />
<dependency id="Serilog.Sinks.Literate" version="3.0.0" exclude="Build,Analyzers" />
<dependency id="Serilog.Sinks.RollingFile" version="3.3.0" exclude="Build,Analyzers" />
<dependency id="ServiceBase" version="1.1.19" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Events.RabbitMQ" version="1.1.19" exclude="Build,Analyzers" />
<dependency id="ServiceBase" version="1.1.20" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Events.RabbitMQ" version="1.1.20" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Mvc" version="1.1.20" exclude="Build,Analyzers" />
<dependency id="AutoMapper" version="6.2.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore" version="2.0.2" exclude="Build,Analyzers" />
Expand All @@ -47,11 +47,11 @@
<dependency id="Pomelo.EntityFrameworkCore.MySql" version="2.0.1" exclude="Build,Analyzers" />
<dependency id="Npgsql.EntityFrameworkCore.PostgreSQL" version="2.0.1" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.SqlServer" version="2.0.2" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Notification.SendGrid" version="1.1.19" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Notification.SendGrid" version="1.1.20" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Mvc.Core" version="2.0.3" exclude="Build,Analyzers" />
<dependency id="MimeKit" version="2.0.2" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Notification.Smtp" version="1.1.19" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Notification.Twilio" version="1.1.19" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Notification.Smtp" version="1.1.20" exclude="Build,Analyzers" />
<dependency id="ServiceBase.Notification.Twilio" version="1.1.20" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.PlatformAbstractions" version="1.1.0" exclude="Build,Analyzers" />
<dependency id="Swashbuckle.AspNetCore" version="2.3.0" exclude="Build,Analyzers" />
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Moq" Version="4.7.145" />
<PackageReference Include="FluentAssertions" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.1" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Moq" Version="4.7.145" />
<PackageReference Include="FluentAssertions" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.1" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ namespace IdentityBase.EntityFramework.UnitTests.Mappers

public class ClientMappersTests
{
// [Fact]
// public void ClientAutomapperConfigurationIsValid()
// {
// ClientMappers.Mapper.ConfigurationProvider
// .AssertConfigurationIsValid();
//
// var model = new Client();
// var mappedEntity = model.ToEntity();
// var mappedModel = mappedEntity.ToModel();
//
// Assert.NotNull(mappedModel);
// Assert.NotNull(mappedEntity);
// }
// [Fact]
// public void ClientAutomapperConfigurationIsValid()
// {
// ClientMappers.Mapper.ConfigurationProvider
// .AssertConfigurationIsValid();
//
// var model = new Client();
// var mappedEntity = model.ToEntity();
// var mappedModel = mappedEntity.ToModel();
//
// Assert.NotNull(mappedModel);
// Assert.NotNull(mappedEntity);
// }

[Fact]
public void Properties_Map()
Expand All @@ -38,7 +38,7 @@ public void Properties_Map()
{"foo2", "bar2"},
}
};

var mappedEntity = model.ToEntity();

mappedEntity.Properties.Count.Should().Be(2);
Expand Down Expand Up @@ -77,7 +77,9 @@ public void Duplicates_properties_in_db_map()
};

Action modelAction = () => entity.ToModel();
modelAction.ShouldThrow<Exception>();

modelAction.Should()
.ThrowExactly<AutoMapper.AutoMapperMappingException>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
<Compile Remove="Tests\ApiInvitationTests.cs" />
<Compile Remove="Tests\GeneralTests.cs" />
<Compile Remove="Tests\InviteTests.cs" />
<Compile Remove="Tests\LandingPageTests.cs" />
<Compile Remove="Tests\LoginTests.cs" />
<Compile Remove="Tests\RecoverTests.cs" />
<Compile Remove="Tests\RecoveryAccontTests.cs" />
<Compile Remove="Tests\RegisterTests.cs" />
</ItemGroup>

Expand Down Expand Up @@ -63,6 +65,10 @@
<ItemGroup>
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<Folder Include="Tests\" />
</ItemGroup>

<!--
Work around https://github.com/NuGet/Home/issues/4412. MVC uses DependencyContext.Load() which looks next to a .dll
Expand Down
30 changes: 16 additions & 14 deletions test/IdentityBase.IntegrationTests/Tests/LandingPageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ namespace IdentityBase.IntegrationTests
using Microsoft.AspNetCore.TestHost;
using Xunit;

[Collection("FooTests")]
public class LandingPageTests
{
[Fact(DisplayName = "Get LandingPage")]
public async Task Get_LandingPage()
{
TestServer server = TestServerBuilderExtensions.CreateServer();

HttpClient client = server.CreateClient();
HttpResponseMessage response = await client.GetAsync("/");
string html = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
}
}
// Landing page does not exists anymore
//
// [Collection("FooTests")]
// public class LandingPageTests
// {
// [Fact(DisplayName = "Get LandingPage")]
// public async Task Get_LandingPage()
// {
// TestServer server = TestServerBuilderExtensions.CreateServer();
//
// HttpClient client = server.CreateClient();
// HttpResponseMessage response = await client.GetAsync("/");
// string html = await response.Content.ReadAsStringAsync();
// response.EnsureSuccessStatusCode();
// }
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,14 @@ public async Task ForgotPassword_Cancel()

HttpClient client = server.CreateClient();

HttpResponseMessage response = await client
.RecoveryGetAndPostFormAsync("alice@localhost");

// Call cancel url
await client.RecoveryCancelGetValidAsync(cancelUrl);

// Calling cancel url again shouldnt be possible
await client.RecoveryCancelGetInvalidAsync(cancelUrl);

// Calling confirm url shouldnt be possible after successfull
// cancelation
await client.RecoveryConfirmGetInvalidAsync(confirmUrl);
}

[Theory(DisplayName = "Forgot password ")]
Expand Down
6 changes: 3 additions & 3 deletions test/IdentityBase.UnitTests/IdentityBase.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Moq" Version="4.7.145" />
<PackageReference Include="FluentAssertions" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.1" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>
Expand Down

0 comments on commit 3f52f44

Please sign in to comment.