示例#1
0
        public void QuitValidator_Invalid_Type()
        {
            // arrange
            // act
            var spreadSheet = new SpreadSheet();
            var command     = new QuitCommand();
            var validator   = new PerformSumValidator();

            // assert
            Assert.ThrowsException <ArgumentException>(() => validator.Validate(spreadSheet, command));
        }
示例#2
0
        public void PerformSumValidator_With_Negative_Y3_Throws_ValidationException()
        {
            // arrange
            // act
            var spreadSheet = new SpreadSheet();

            spreadSheet.Cells.Add(new Cell(1, 1));
            spreadSheet.Cells.Add(new Cell(2, 1));
            spreadSheet.Cells.Add(new Cell(3, 1));
            var command   = new PerformSumCommand(1, 2, 2, 1, 3, -1);
            var validator = new PerformSumValidator();

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