Ejemplo n.º 1
0
        public void InsertNumberValidator_With_Negative_V1_Throws_ValidationException()
        {
            // arrange
            // act
            var spreadSheet = new SpreadSheet();
            var command     = new InsertNumberCommand(1, 1, -1);
            var validator   = new InsertNumberValidator();

            // assert
            Assert.ThrowsException <ValidationException>(() => validator.Validate(spreadSheet, command));
        }
Ejemplo n.º 2
0
        public void InsertNumberValidator_Out_Of_Range_Throws_ValidationException()
        {
            // arrange
            // act
            var spreadSheet = new SpreadSheet();

            spreadSheet.Cells.Add(new Cell(1, 1));
            var command   = new InsertNumberCommand(1, 20, 1);
            var validator = new InsertNumberValidator();

            // assert
            Assert.ThrowsException <ValidationException>(() => validator.Validate(spreadSheet, command));
        }