コード例 #1
0
        public void GivenGameWhenRegisterThenExpectedValue(string name, string acquisicionDate, int kind, string observation, bool expectedResult)
        {
            // Arrange
            var date        = DateTime.Parse(acquisicionDate);
            var validator   = new RegisterNewGameCommandValidation();
            var gameCommand = new RegisterNewGameCommand
            {
                Name            = name,
                AcquisicionDate = date,
                Kind            = kind,
                Observation     = observation
            };

            // Act
            var result = validator.Validate(gameCommand);

            // Assert
            result.IsValid.Should().Be(expectedResult);
        }
コード例 #2
0
 public override bool IsValid()
 {
     ValidationResult = new RegisterNewGameCommandValidation().Validate(this);
     return(ValidationResult.IsValid);
 }