Пример #1
0
        public void TestDiscount()
        {
            // arrange
            List <string> data = new List <string>();

            data.Add("[email protected] 2021-02-11 10:00 !SALE1102 P01 1");
            data.Add("[email protected] 2021-02-11 15:00 P02b 2");
            data.Add("[email protected] 2021-02-11 12:30 !SALE1102");
            data.Add("P01");
            data.Add("P42 5");
            IData fileData = new DataStub(data);
            ITime time     = new TimeStub(new DateTime(2021, 02, 11));

            // act
            ReportsGenerator.TodaysOrdersReport(fileData, time);
            bool isError = ReportsGenerator.isError;

            // assert
            isError.Should().BeFalse();
        }
Пример #2
0
        public void TestErrorLineNumber()
        {
            // arrange
            List <string> data = new List <string>();

            data.Add("[email protected] 2021-02-11 10:00 P01 1");
            data.Add("[email protected] 2021-02-11 15:00 P02b 2");
            data.Add("[email protected] 21-02-2011 12:30");
            data.Add("P01");
            data.Add("P42 5");
            IData fileData  = new DataStub(data);
            ITime time      = new TimeStub(new DateTime(2021, 02, 11));
            int   errorLine = 3;

            // act
            ReportsGenerator.TodaysOrdersReport(fileData, time);
            int line = ReportsGenerator.lineNumber;

            // assert
            errorLine.Should().Be(line);
        }