Пример #1
0
        public async Task Input_Process_OutputNotExpected()
        {
            var fakeDataProvider = A.Fake <IDataProvider>();

            A.CallTo(() => fakeDataProvider.GetData()).Returns(InputData());
            var dataProvider = DataProviderFactory.Create();
            var resolver     = new Sudoku_Solver.Sudoku9X9Solver(
                InputValidatorFactory.Create());

            var(result, outputMatrix) = await resolver.Process(await fakeDataProvider.GetData());

            Assert.IsTrue(result);
            Assert.IsFalse(MatchMatricResult(outputMatrix, InvalidExpectedOutput()));
        }
Пример #2
0
        public void Input_ValidData_Success()
        {
            var validator = InputValidatorFactory.Create();

            validator.Validate(ValidData());
        }
Пример #3
0
        public void Input_InvalidNumber_ThrowInputValidatorEx()
        {
            var validator = InputValidatorFactory.Create();

            Assert.Throws <InputValidatorException>(() => validator.Validate(InvalidNumberInInput()));
        }
Пример #4
0
        public void Input_DuplicateNumberInColumn_ThrowInputValidatorEx()
        {
            var validator = InputValidatorFactory.Create();

            Assert.Throws <InputValidatorException>(() => validator.Validate(InvalidDataWithDuplicateInColumn()));
        }
Пример #5
0
        public void Input_MinDataNotPresent_ThrowInputValidatorEx()
        {
            var validator = InputValidatorFactory.Create();

            Assert.Throws <InputValidatorException>(() => validator.Validate(MandatoryDataNotPresent()));
        }
Пример #6
0
        public void Input_Matrix9X9NotMatching_ThrowInputValidatorE()
        {
            var validator = InputValidatorFactory.Create();

            Assert.Throws <InputValidatorException>(() => validator.Validate(InvalidMatrixSize()));
        }