-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Working on fix for 179 * merge * Fix build warnings * Fixing tests Added fix for 179 Added test to confirm fix
- Loading branch information
Showing
21 changed files
with
149 additions
and
39 deletions.
There are no files selected for viewing
27 changes: 13 additions & 14 deletions
27
sample/Ardalis.Result.Sample.Core/Ardalis.Result.Sample.Core.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<AssemblyName>Ardalis.Result.Sample.Core</AssemblyName> | ||
<RootNamespace>Ardalis.Result.Sample.Core</RootNamespace> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<AssemblyName>Ardalis.Result.Sample.Core</AssemblyName> | ||
<RootNamespace>Ardalis.Result.Sample.Core</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" /> | ||
<PackageReference Include="System.ComponentModel.Annotations" /> | ||
<PackageReference Include="System.Runtime" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Ardalis.Result.FluentValidation\Ardalis.Result.FluentValidation.csproj" /> | ||
<ProjectReference Include="..\..\src\Ardalis.Result\Ardalis.Result.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" /> | ||
<PackageReference Include="System.ComponentModel.Annotations" /> | ||
<PackageReference Include="System.Runtime" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Ardalis.Result.FluentValidation\Ardalis.Result.FluentValidation.csproj" /> | ||
<ProjectReference Include="..\..\src\Ardalis.Result\Ardalis.Result.csproj" /> | ||
</ItemGroup> | ||
</Project> |
8 changes: 5 additions & 3 deletions
8
sample/Ardalis.Result.Sample.Core/DTOs/CreatePersonRequestDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
namespace Ardalis.Result.Sample.Core.DTOs; | ||
using System; | ||
|
||
namespace Ardalis.Result.Sample.Core.DTOs; | ||
|
||
public class CreatePersonRequestDto | ||
{ | ||
public string FirstName { get; set; } | ||
public string LastName { get; set; } | ||
public string FirstName { get; set; } = String.Empty; | ||
public string LastName { get; set; } = String.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
| ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Ardalis.Result.Sample.Core.DTOs | ||
{ | ||
public class ForecastRequestDto | ||
{ | ||
[Required] | ||
public string PostalCode { get; set; } | ||
public string PostalCode { get; set; } = String.Empty; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tests/Ardalis.Result.AspNetCore.UnitTests/ResultStatusMapAddDefaultMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Xunit; | ||
|
||
namespace Ardalis.Result.AspNetCore.UnitTests; | ||
|
||
public class ResultStatusMapAddDefaultMap | ||
{ | ||
[Fact] | ||
public void ReturnsBadRequestGivenInvalid() | ||
{ | ||
var controller = new TestController(); | ||
|
||
var result = Result<int>.Invalid(new ValidationError("test")); | ||
|
||
// TODO: require identifier | ||
Assert.True(true); | ||
} | ||
|
||
public class TestController : ControllerBase | ||
{ | ||
public Result Index() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Result<string> ResultString() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Result<IEnumerable<string>> ResultEnumerableString() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters