Ejemplo n.º 1
0
        public void ShouldNotHaveAnyValidationErrors(int x, int y, decimal radius)
        {
            var options = new OptionsWrapper <CbRfCurseSettings>(new CbRfCurseSettings {
                Radius = radius
            });
            var validator = new CursRequestValidator(options);
            var command   = new CursRequest
            {
                X = x,
                Y = y
            };
            var result = validator.TestValidate(command);

            result.ShouldNotHaveAnyValidationErrors();
        }
Ejemplo n.º 2
0
        public void ShouldHaveAnyValidationError(int x, int y, decimal radius)
        {
            var options = new OptionsWrapper <CbRfCurseSettings>(new CbRfCurseSettings {
                Radius = radius
            });
            var validator = new CursRequestValidator(options);
            var command   = new CursRequest
            {
                X = x,
                Y = y
            };
            Action act = () => validator.Validate(command, options =>
            {
                options.ThrowOnFailures();
            });

            act.Should().Throw <RadiusInvalidException>();
        }