Browse Source

Refactoring Essentials added

pull/107/head
Sebastian Stehle 9 years ago
parent
commit
9753cfbeac
  1. 19
      Squidex.ruleset
  2. 2
      src/Squidex.Domain.Apps.Core/Scripting/ContentWrapper/ContentDataObject.cs
  3. 2
      src/Squidex.Domain.Apps.Core/Scripting/ContentWrapper/ContentFieldObject.cs
  4. 1
      src/Squidex.Domain.Apps.Core/Squidex.Domain.Apps.Core.csproj
  5. 1
      src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj
  6. 1
      src/Squidex.Domain.Apps.Read.MongoDb/Squidex.Domain.Apps.Read.MongoDb.csproj
  7. 6
      src/Squidex.Domain.Apps.Read.MongoDb/Utils/MongoCollectionExtensions.cs
  8. 2
      src/Squidex.Domain.Apps.Read/Contents/Edm/EdmModelExtensions.cs
  9. 1
      src/Squidex.Domain.Apps.Read/Squidex.Domain.Apps.Read.csproj
  10. 2
      src/Squidex.Domain.Apps.Read/Webhooks/WebhookEnqueuer.cs
  11. 1
      src/Squidex.Domain.Apps.Write/Squidex.Domain.Apps.Write.csproj
  12. 1
      src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj
  13. 1
      src/Squidex.Domain.Users/Squidex.Domain.Users.csproj
  14. 1
      src/Squidex.Infrastructure.Azure/Squidex.Infrastructure.Azure.csproj
  15. 1
      src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj
  16. 1
      src/Squidex.Infrastructure.GoogleCloud/Squidex.Infrastructure.GoogleCloud.csproj
  17. 1
      src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj
  18. 1
      src/Squidex.Infrastructure.RabbitMq/Squidex.Infrastructure.RabbitMq.csproj
  19. 1
      src/Squidex.Infrastructure.Redis/Squidex.Infrastructure.Redis.csproj
  20. 2
      src/Squidex.Infrastructure/CQRS/Events/DefaultStreamNameResolver.cs
  21. 6
      src/Squidex.Infrastructure/CollectionExtensions.cs
  22. 12
      src/Squidex.Infrastructure/Reflection/SimpleMapper.cs
  23. 1
      src/Squidex.Infrastructure/Squidex.Infrastructure.csproj
  24. 2
      src/Squidex.Infrastructure/ValidationExtensions.cs
  25. 1
      src/Squidex.Shared/Squidex.Shared.csproj
  26. 2
      src/Squidex/Config/Identity/GoogleHandler.cs
  27. 4
      src/Squidex/Controllers/UI/Account/AccountController.cs
  28. 1
      src/Squidex/Squidex.csproj
  29. 1
      tests/Benchmarks/Benchmarks.csproj
  30. 1
      tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj
  31. 1
      tests/Squidex.Domain.Apps.Read.Tests/Squidex.Domain.Apps.Read.Tests.csproj
  32. 2
      tests/Squidex.Domain.Apps.Read.Tests/Webhooks/WebhookDequeuerTests.cs
  33. 1
      tests/Squidex.Domain.Apps.Write.Tests/Squidex.Domain.Apps.Write.Tests.csproj
  34. 2
      tests/Squidex.Domain.Users.Tests/AssetUserPictureStoreTests.cs
  35. 1
      tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj
  36. 6
      tests/Squidex.Infrastructure.Tests/Assets/AssetStoreTests.cs
  37. 6
      tests/Squidex.Infrastructure.Tests/Log/SemanticLogTests.cs
  38. 1
      tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj
  39. 1
      tools/Migrate_01/Migrate_01.csproj

19
Squidex.ruleset

@ -37,7 +37,7 @@
<Rule Id="SA1311" Action="Error" />
<Rule Id="SA1400" Action="Error" />
<Rule Id="SA1401" Action="Error" />
<Rule Id="SA1402" Action="None" />
<Rul Id="SA1402" Action="None" />
<Rule Id="SA1407" Action="Error" />
<Rule Id="SA1408" Action="None" />
<Rule Id="SA1502" Action="Error" />
@ -61,4 +61,21 @@
<Rule Id="SA1652" Action="None" />
<Rule Id="SA1404" Action="None" />
</Rules>
<Rules AnalyzerId="RefactoringEssentials" RuleNamespace="RefactoringEssentials">
<Rule Id="RECS0061" Action="Error" />
<Rule Id="RECS0017" Action="Error" />
<Rule Id="RECS0060" Action="Error" />
<Rule Id="RECS0062" Action="Error" />
<Rule Id="RECS0063" Action="Error" />
<Rule Id="RECS0064" Action="Error" />
<Rule Id="RECS0133" Action="Error" />
<Rule Id="REVB0145" Action="None" />
<Rule Id="RECS0002" Action="Error" />
<Rule Id="RECS0154" Action="None" />
<Rule Id="RECS0146" Action="Error" />
<Rule Id="RECS0026" Action="Error" />
</Rules>
<Rules AnalyzerId="Roslyn.Core" RuleNamespace="Roslyn.Core">
<Rule Id="AD0001" Action="None" />
</Rules>
</RuleSet>

2
src/Squidex.Domain.Apps.Core/Scripting/ContentWrapper/ContentDataObject.cs

@ -14,6 +14,8 @@ using Jint.Runtime.Descriptors;
using Squidex.Domain.Apps.Core.Contents;
using Squidex.Infrastructure;
#pragma warning disable RECS0133 // Parameter name differs in base declaration
namespace Squidex.Domain.Apps.Core.Scripting.ContentWrapper
{
public sealed class ContentDataObject : ObjectInstance

2
src/Squidex.Domain.Apps.Core/Scripting/ContentWrapper/ContentFieldObject.cs

@ -12,6 +12,8 @@ using Jint.Runtime.Descriptors;
using Squidex.Domain.Apps.Core.Contents;
using Squidex.Infrastructure;
#pragma warning disable RECS0133 // Parameter name differs in base declaration
namespace Squidex.Domain.Apps.Core.Scripting.ContentWrapper
{
public sealed class ContentFieldObject : ObjectInstance

1
src/Squidex.Domain.Apps.Core/Squidex.Domain.Apps.Core.csproj

@ -15,6 +15,7 @@
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="NJsonSchema" Version="9.5.0" />
<PackageReference Include="NodaTime" Version="2.2.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />

1
src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj

@ -12,6 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="NodaTime" Version="2.2.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
</ItemGroup>

1
src/Squidex.Domain.Apps.Read.MongoDb/Squidex.Domain.Apps.Read.MongoDb.csproj

@ -16,6 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.OData.Core" Version="7.3.1" />
<PackageReference Include="MongoDB.Driver" Version="2.4.4" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
</ItemGroup>

6
src/Squidex.Domain.Apps.Read.MongoDb/Utils/MongoCollectionExtensions.cs

@ -18,7 +18,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Utils
{
public static class MongoCollectionExtensions
{
public static Task CreateAsync<T>(this IMongoCollection<T> collection, SquidexEvent @event, EnvelopeHeaders headers, Action<T> updater) where T : IMongoEntity, new()
public static Task CreateAsync<T>(this IMongoCollection<T> collection, SquidexEvent @event, EnvelopeHeaders headers, Action<T> updater) where T : class, IMongoEntity, new()
{
var entity = EntityMapper.Create<T>(@event, headers);
@ -27,7 +27,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Utils
return collection.InsertOneIfNotExistsAsync(entity);
}
public static async Task CreateAsync<T>(this IMongoCollection<T> collection, SquidexEvent @event, EnvelopeHeaders headers, Func<T, Task> updater) where T : IMongoEntity, new()
public static async Task CreateAsync<T>(this IMongoCollection<T> collection, SquidexEvent @event, EnvelopeHeaders headers, Func<T, Task> updater) where T : class, IMongoEntity, new()
{
var entity = EntityMapper.Create<T>(@event, headers);
@ -36,7 +36,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Utils
await collection.InsertOneIfNotExistsAsync(entity);
}
public static async Task UpdateAsync<T>(this IMongoCollection<T> collection, SquidexEvent @event, EnvelopeHeaders headers, Action<T> updater) where T : IMongoEntity, new()
public static async Task UpdateAsync<T>(this IMongoCollection<T> collection, SquidexEvent @event, EnvelopeHeaders headers, Action<T> updater) where T : class, IMongoEntity, new()
{
var entity = await collection.Find(t => t.Id == headers.AggregateId()).FirstOrDefaultAsync();

2
src/Squidex.Domain.Apps.Read/Contents/Edm/EdmModelExtensions.cs

@ -26,7 +26,7 @@ namespace Squidex.Domain.Apps.Read.Contents.Edm
var path = model.EntityContainer.EntitySets().First().Path.Path.Split('.').Last();
if (query.StartsWith("?"))
if (query.StartsWith("?", StringComparison.Ordinal))
{
query = query.Substring(1);
}

1
src/Squidex.Domain.Apps.Read/Squidex.Domain.Apps.Read.csproj

@ -15,6 +15,7 @@
<PackageReference Include="GraphQL" Version="0.17.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.2" />
<PackageReference Include="NodaTime" Version="2.2.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.8.0" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />

2
src/Squidex.Domain.Apps.Read/Webhooks/WebhookEnqueuer.cs

@ -134,7 +134,7 @@ namespace Squidex.Domain.Apps.Read.Webhooks
private static string CreateContentEventName(string eventType)
{
return eventType.StartsWith(ContentPrefix) ? eventType.Substring(ContentPrefix.Length) : eventType;
return eventType.StartsWith(ContentPrefix, StringComparison.Ordinal) ? eventType.Substring(ContentPrefix.Length) : eventType;
}
}
}

1
src/Squidex.Domain.Apps.Write/Squidex.Domain.Apps.Write.csproj

@ -15,6 +15,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="NodaTime" Version="2.2.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
</ItemGroup>

1
src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj

@ -17,6 +17,7 @@
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.1.2" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.4.0" />
<PackageReference Include="MongoDB.Driver" Version="2.4.4" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.4.0" />
</ItemGroup>

1
src/Squidex.Domain.Users/Squidex.Domain.Users.csproj

@ -13,6 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.1.2" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.4.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.Linq.Queryable" Version="4.3.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.4.0" />

1
src/Squidex.Infrastructure.Azure/Squidex.Infrastructure.Azure.csproj

@ -4,6 +4,7 @@
<RootNamespace>Squidex.Infrastructure</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="WindowsAzure.Storage" Version="8.4.0" />
</ItemGroup>

1
src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj

@ -9,6 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EventStore.ClientAPI.NetCore" Version="4.0.0-alpha-1" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
</ItemGroup>
<ItemGroup>

1
src/Squidex.Infrastructure.GoogleCloud/Squidex.Infrastructure.GoogleCloud.csproj

@ -9,6 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Cloud.Storage.V1" Version="2.0.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
</ItemGroup>

1
src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj

@ -12,6 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.4.4" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
</ItemGroup>

1
src/Squidex.Infrastructure.RabbitMq/Squidex.Infrastructure.RabbitMq.csproj

@ -9,6 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RabbitMQ.Client" Version="5.0.1" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
</ItemGroup>

1
src/Squidex.Infrastructure.Redis/Squidex.Infrastructure.Redis.csproj

@ -11,6 +11,7 @@
<ProjectReference Include="..\Squidex.Infrastructure\Squidex.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StackExchange.Redis.StrongName" Version="1.2.6" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />

2
src/Squidex.Infrastructure/CQRS/Events/DefaultStreamNameResolver.cs

@ -18,7 +18,7 @@ namespace Squidex.Infrastructure.CQRS.Events
{
var typeName = char.ToLower(aggregateType.Name[0]) + aggregateType.Name.Substring(1);
if (typeName.EndsWith(Suffix))
if (typeName.EndsWith(Suffix, StringComparison.Ordinal))
{
typeName = typeName.Substring(0, typeName.Length - Suffix.Length);
}

6
src/Squidex.Infrastructure/CollectionExtensions.cs

@ -25,7 +25,7 @@ namespace Squidex.Infrastructure
foreach (var item in collection)
{
if (item != null)
if (!Equals(item, null))
{
hashCode = (hashCode * 23) + comparer.GetHashCode(item);
}
@ -43,7 +43,7 @@ namespace Squidex.Infrastructure
{
Guard.NotNull(comparer, nameof(comparer));
var hashCodes = collection.Where(x => x != null).Select(x => x.GetHashCode()).OrderBy(x => x).ToArray();
var hashCodes = collection.Where(x => !Equals(x, null)).Select(x => x.GetHashCode()).OrderBy(x => x).ToArray();
var hashCode = 17;
@ -68,7 +68,7 @@ namespace Squidex.Infrastructure
{
hashCode = (hashCode * 23) + keyComparer.GetHashCode(kvp.Key);
if (kvp.Value != null)
if (!Equals(kvp.Value, null))
{
hashCode = (hashCode * 23) + valueComparer.GetHashCode(kvp.Value);
}

12
src/Squidex.Infrastructure/Reflection/SimpleMapper.cs

@ -11,6 +11,8 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
#pragma warning disable RECS0108 // Warns about static fields in generic types
namespace Squidex.Infrastructure.Reflection
{
public static class SimpleMapper
@ -25,7 +27,7 @@ namespace Squidex.Infrastructure.Reflection
this.targetType = targetType;
}
public override void Map(object source, object destination, CultureInfo culture)
public override void MapProperty(object source, object destination, CultureInfo culture)
{
var value = GetValue(source);
@ -64,7 +66,7 @@ namespace Squidex.Infrastructure.Reflection
this.dstAccessor = dstAccessor;
}
public virtual void Map(object source, object destination, CultureInfo culture)
public virtual void MapProperty(object source, object destination, CultureInfo culture)
{
var value = GetValue(source);
@ -139,11 +141,11 @@ namespace Squidex.Infrastructure.Reflection
Mappers = newMappers.ToArray();
}
public static TDestination Map(TSource source, TDestination destination, CultureInfo culture)
public static TDestination MapClass(TSource source, TDestination destination, CultureInfo culture)
{
foreach (var mapper in Mappers)
{
mapper.Map(source, destination, culture);
mapper.MapProperty(source, destination, culture);
}
return destination;
@ -172,7 +174,7 @@ namespace Squidex.Infrastructure.Reflection
Guard.NotNull(culture, nameof(culture));
Guard.NotNull(destination, nameof(destination));
return ClassMapper<TSource, TDestination>.Map(source, destination, culture);
return ClassMapper<TSource, TDestination>.MapClass(source, destination, culture);
}
}
}

1
src/Squidex.Infrastructure/Squidex.Infrastructure.csproj

@ -13,6 +13,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="NodaTime" Version="2.2.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<PackageReference Include="System.Reactive" Version="3.1.1" />

2
src/Squidex.Infrastructure/ValidationExtensions.cs

@ -11,6 +11,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
#pragma warning disable RECS0026 // Possible unassigned object created by 'new'
namespace Squidex.Infrastructure
{
public static class ValidationExtensions

1
src/Squidex.Shared/Squidex.Shared.csproj

@ -7,6 +7,7 @@
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.Security.Claims" Version="4.3.0" />
</ItemGroup>

2
src/Squidex/Config/Identity/GoogleHandler.cs

@ -38,7 +38,7 @@ namespace Squidex.Config.Identity
{
pictureUrl = context.User?["image"]?.Value<string>("url");
if (pictureUrl != null && pictureUrl.EndsWith("?sz=50"))
if (pictureUrl != null && pictureUrl.EndsWith("?sz=50", System.StringComparison.Ordinal))
{
pictureUrl = pictureUrl.Substring(0, pictureUrl.Length - 6);
}

4
src/Squidex/Controllers/UI/Account/AccountController.cs

@ -193,7 +193,7 @@ namespace Squidex.Controllers.UI.Account
[HttpGet]
[Route("account/external-callback/")]
public async Task<IActionResult> ExternalCallback(string returnUrl = null, string remoteError = null)
public async Task<IActionResult> ExternalCallback(string returnUrl = null)
{
var externalLogin = await signInManager.GetExternalLoginInfoWithDisplayNameAsync();
@ -308,7 +308,7 @@ namespace Squidex.Controllers.UI.Account
user.SetClaim(SquidexClaimTypes.SquidexDisplayName, email);
}
foreach (var squidexClaim in externalLogin.Principal.Claims.Where(c => c.Type.StartsWith(SquidexClaimTypes.Prefix)))
foreach (var squidexClaim in externalLogin.Principal.Claims.Where(c => c.Type.StartsWith(SquidexClaimTypes.Prefix, StringComparison.Ordinal)))
{
user.AddClaim(squidexClaim);
}

1
src/Squidex/Squidex.csproj

@ -77,6 +77,7 @@
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="2.0.0" />
<PackageReference Include="NSwag.AspNetCore" Version="11.5.1" />
<PackageReference Include="OpenCover" Version="4.6.519" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="ReportGenerator" Version="2.5.11" />
<PackageReference Include="StackExchange.Redis.StrongName" Version="1.2.6" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />

1
tests/Benchmarks/Benchmarks.csproj

@ -9,6 +9,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.4.4" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
</ItemGroup>

1
tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj

@ -12,6 +12,7 @@
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="xunit" Version="2.2.0" />

1
tests/Squidex.Domain.Apps.Read.Tests/Squidex.Domain.Apps.Read.Tests.csproj

@ -21,6 +21,7 @@
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="MongoDB.Driver" Version="2.4.4" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="xunit" Version="2.2.0" />

2
tests/Squidex.Domain.Apps.Read.Tests/Webhooks/WebhookDequeuerTests.cs

@ -15,6 +15,8 @@ using Squidex.Domain.Apps.Read.Webhooks.Repositories;
using Squidex.Infrastructure.Log;
using Xunit;
#pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void
namespace Squidex.Domain.Apps.Read.Webhooks
{
public class WebhookDequeuerTests

1
tests/Squidex.Domain.Apps.Write.Tests/Squidex.Domain.Apps.Write.Tests.csproj

@ -13,6 +13,7 @@
<PackageReference Include="FakeItEasy" Version="4.0.0" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="xunit" Version="2.2.0" />

2
tests/Squidex.Domain.Users.Tests/AssetUserPictureStoreTests.cs

@ -14,6 +14,8 @@ using Squidex.Infrastructure.Assets;
using Squidex.Infrastructure.Tasks;
using Xunit;
#pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void
namespace Squidex.Domain.Users
{
public class AssetUserPictureStoreTests

1
tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj

@ -14,6 +14,7 @@
<PackageReference Include="FakeItEasy" Version="4.0.0" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="xunit" Version="2.2.0" />

6
tests/Squidex.Infrastructure.Tests/Assets/AssetStoreTests.cs

@ -15,16 +15,16 @@ namespace Squidex.Infrastructure.Assets
{
public abstract class AssetStoreTests<T> : IDisposable where T : IAssetStore
{
private readonly T sut;
private readonly Lazy<T> sut;
protected AssetStoreTests()
{
sut = CreateStore();
sut = new Lazy<T>(CreateStore);
}
protected T Sut
{
get { return sut; }
get { return sut.Value; }
}
public abstract T CreateStore();

6
tests/Squidex.Infrastructure.Tests/Log/SemanticLogTests.cs

@ -240,7 +240,7 @@ namespace Squidex.Infrastructure.Log
.WriteProperty("message", "My Message")
.WriteProperty("elapsedMs", 0));
Assert.True(output.StartsWith(expected.Substring(0, 55)));
Assert.True(output.StartsWith(expected.Substring(0, 55), StringComparison.Ordinal));
}
[Fact]
@ -254,7 +254,7 @@ namespace Squidex.Infrastructure.Log
.WriteProperty("message", "My Message")
.WriteProperty("elapsedMs", 0));
Assert.True(output.StartsWith(expected.Substring(0, 55)));
Assert.True(output.StartsWith(expected.Substring(0, 55), StringComparison.Ordinal));
}
[Fact]
@ -268,7 +268,7 @@ namespace Squidex.Infrastructure.Log
.WriteProperty("message", "My Message")
.WriteProperty("elapsedMs", 0));
Assert.True(output.StartsWith(expected.Substring(0, 55)));
Assert.True(output.StartsWith(expected.Substring(0, 55), StringComparison.Ordinal));
}
[Fact]

1
tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj

@ -16,6 +16,7 @@
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="xunit" Version="2.2.0" />

1
tools/Migrate_01/Migrate_01.csproj

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.4.4" />
<PackageReference Include="RefactoringEssentials" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
</ItemGroup>
<PropertyGroup>

Loading…
Cancel
Save