Exemplo n.º 1
0
        public void ReceiptCreating_FullReceiptCreating_NullBitmap()
        {
            //arrange
            ReceiptMaking receiptCreating = new ReceiptMaking(ocr.Object, shopDetection.Object);

            //act
            //assert
            Assert.Throws <ArgumentNullException>(() => receiptCreating.FullReceiptCreating(null));
        }
Exemplo n.º 2
0
        public void ReceiptCreating_FullReceiptCreating_EmptyBitmap()
        {
            //arrange
            Bitmap        image           = new Bitmap(1, 1);
            ReceiptMaking receiptCreating = new ReceiptMaking(ocr.Object, shopDetection.Object);

            //act
            //assert
            Assert.Throws <ArgumentNullException>(() => receiptCreating.FullReceiptCreating(image));
        }
Exemplo n.º 3
0
        public void ReceiptCreating_GetDateForReceipt_TodayDate()
        {
            //arrange
            List <string> linesOfText = new List <string>();

            linesOfText.AddMany(fixture.Create <string>, 10);
            ReceiptMaking receiptCreating = new ReceiptMaking(ocr.Object, shopDetection.Object);

            //act
            //assert
            Assert.Equal(DateTime.Now.ToString("d"), receiptCreating.GetDateForReceipt(linesOfText).ToString());
        }
Exemplo n.º 4
0
        public void ReceiptCreating_GetDateForReceipt_RandomDate()
        {
            //arrange
            var           dateTime    = fixture.Create <DateTime>();
            List <string> linesOfText = new List <string>
            {
                dateTime.ToString()
            };

            linesOfText.AddMany(fixture.Create <string>, 10);
            ReceiptMaking receiptCreating = new ReceiptMaking(ocr.Object, shopDetection.Object);

            //act
            //assert
            Assert.Equal(dateTime.ToString("d"), receiptCreating.GetDateForReceipt(linesOfText).ToString());
        }