Example #1
0
        public void Test_InsertCellByLine_ExcelNotExists_ExcelNotCreatedException()
        {
            var excelService = A.Fake <IExcelService>();

            A.CallTo(() => excelService.ExcelExists()).Returns(false);

            var command = new InsertLineCommand(excelService);

            command.Execute(new string[] { "L", "1", "2", "6", "2" });
        }
Example #2
0
        public void Test_UpdateCellsByLine_ParameterInvalid_InvalidValueException()
        {
            var excelService = A.Fake <IExcelService>();

            A.CallTo(() => excelService.ExcelExists()).Returns(true);

            var command = new InsertLineCommand(excelService);

            command.Execute(new string[] { "L", "a", "2", "6", "2" });
        }
Example #3
0
        public void Test_InsertCellByLine_1_2_6_2_Success()
        {
            var excelService = A.Fake <IExcelService>();

            A.CallTo(() => excelService.ExcelExists()).Returns(true);

            var command = new InsertLineCommand(excelService);

            command.Execute(new string[] { "L", "1", "2", "6", "2" });

            A.CallTo(() => excelService.UpdateCellsByLine(1, 2, 6, 2, "x")).MustHaveHappenedOnceExactly();
        }