massive checkpoint
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
using FluentValidation;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Types;
|
||||
|
||||
namespace Gameboard.ShogiUI.Sockets.Services.RequestValidators
|
||||
{
|
||||
public class CreateGameRequestValidator : AbstractValidator<CreateGameRequest>
|
||||
{
|
||||
public CreateGameRequestValidator()
|
||||
{
|
||||
RuleFor(_ => _.Action).Equal(ClientAction.CreateGame);
|
||||
RuleFor(_ => _.GameName).NotEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentValidation;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Types;
|
||||
|
||||
namespace Gameboard.ShogiUI.Sockets.Services.RequestValidators
|
||||
{
|
||||
public class ListGamesRequestValidator : AbstractValidator<ListGamesRequest>
|
||||
{
|
||||
public ListGamesRequestValidator()
|
||||
{
|
||||
RuleFor(_ => _.Action).Equal(ClientAction.ListGames);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using FluentValidation;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Types;
|
||||
|
||||
namespace Gameboard.ShogiUI.Sockets.Services.RequestValidators
|
||||
{
|
||||
public class LoadGameRequestValidator : AbstractValidator<LoadGameRequest>
|
||||
{
|
||||
public LoadGameRequestValidator()
|
||||
{
|
||||
RuleFor(_ => _.Action).Equal(ClientAction.LoadGame);
|
||||
RuleFor(_ => _.GameName).NotEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using FluentValidation;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket;
|
||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Types;
|
||||
|
||||
namespace Gameboard.ShogiUI.Sockets.Services.RequestValidators
|
||||
{
|
||||
public class MoveRequestValidator : AbstractValidator<MoveRequest>
|
||||
{
|
||||
public MoveRequestValidator()
|
||||
{
|
||||
RuleFor(_ => _.Action).Equal(ClientAction.Move);
|
||||
RuleFor(_ => _.GameName).NotEmpty();
|
||||
RuleFor(_ => _.Move.From)
|
||||
.Null()
|
||||
.When(_ => _.Move.PieceFromCaptured.HasValue)
|
||||
.WithMessage("Move.From and Move.PieceFromCaptured are mutually exclusive properties.");
|
||||
RuleFor(_ => _.Move.From)
|
||||
.NotEmpty()
|
||||
.When(_ => !_.Move.PieceFromCaptured.HasValue)
|
||||
.WithMessage("Move.From and Move.PieceFromCaptured are mutually exclusive properties.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user