コード例 #1
0
        public void PrintNonFiscalString()
        {
            bool isFiscal           = false;
            bool isReturn           = false;
            bool canceleOpenedCheck = true;
            int  checkNumber;
            int  sessionNumber;

            Res = Fr.ОткрытьЧек(Device, isFiscal, isReturn, canceleOpenedCheck, out checkNumber, out sessionNumber);

            Assert.IsTrue(Res, MessageError);
            Assert.AreNotEqual(checkNumber, 0);
            Assert.AreNotEqual(sessionNumber, 0);

            string text = "Нефискальная строка";

            Res = Fr.НапечататьНефискСтроку(Device, text);

            Assert.IsTrue(Res, MessageError);

            double cash             = 100;
            double payByCard        = 0;
            double payByCredit      = 0;
            double payByCertificate = 0;

            Res = Fr.ЗакрытьЧек(Device, cash, payByCard, payByCredit, payByCertificate);

            Assert.IsTrue(Res, MessageError);
        }
コード例 #2
0
        public void OpenCheck()
        {
            bool isFiscal           = true;
            bool isReturn           = false;
            bool canceleOpenedCheck = true;
            int  checkNumber;
            int  sessionNumber;

            Res = Fr.ОткрытьЧек(Device, isFiscal, isReturn, canceleOpenedCheck, out checkNumber, out sessionNumber);

            Assert.IsTrue(Res, MessageError);
            Assert.AreNotEqual(checkNumber, 0);
            Assert.AreNotEqual(sessionNumber, 0);
        }
コード例 #3
0
        public void PrintFiscalString()
        {
            bool isFiscal           = true;
            bool isReturn           = false;
            bool canceleOpenedCheck = true;
            int  checkNumber;
            int  sessionNumber;

            Res = Fr.ОткрытьЧек(Device, isFiscal, isReturn, canceleOpenedCheck, out checkNumber, out sessionNumber);

            Assert.IsTrue(Res, MessageError);
            Assert.AreNotEqual(checkNumber, 0);
            Assert.AreNotEqual(sessionNumber, 0);

            string name       = "Мясо";
            double quantity   = 10;
            double price      = 5;
            double amount     = quantity * price;
            int    department = 1;
            double tax        = 10;

            Res = Fr.НапечататьФискСтроку(Device, name, quantity, price, amount, department, tax);

            Assert.IsTrue(Res, MessageError);

            string text = "Нефискальная строка";

            Res = Fr.НапечататьНефискСтроку(Device, text);

            Assert.IsTrue(Res, MessageError);

            double cash             = 1000;
            double payByCard        = 0;
            double payByCredit      = 0;
            double payByCertificate = 0;

            Res = Fr.ЗакрытьЧек(Device, cash, payByCard, payByCredit, payByCertificate);

            Assert.IsTrue(Res, MessageError);
        }
コード例 #4
0
        public void PrintCheckWithDicound()
        {
            bool isFiscal           = true;
            bool isReturn           = false;
            bool canceleOpenedCheck = true;
            int  checkNumber;
            int  sessionNumber;

            string name     = "Мясо";
            double quantity = 28;
            double price    = 251.01;
            double amount   = 6676.87;

            int    department       = 1;
            double tax              = 10;
            double cash             = 6676.87;
            double payByCard        = 0;
            double payByCredit      = 0;
            double payByCertificate = 0;

            Res = Fr.ОткрытьЧек(Device, isFiscal, isReturn, canceleOpenedCheck, out checkNumber, out sessionNumber);

            Assert.IsTrue(Res, MessageError);
            Assert.AreNotEqual(checkNumber, 0);
            Assert.AreNotEqual(sessionNumber, 0);

            Res = Fr.НапечататьФискСтроку(Device, name, quantity, price, amount, department, tax);
            Assert.IsTrue(Res, MessageError);
            // скидка на чеке должна быть = 351.41
            string text = "Нефискальная строка";

            Res = Fr.НапечататьНефискСтроку(Device, text);
            Assert.IsTrue(Res, MessageError);

            Res = Fr.ЗакрытьЧек(Device, cash, payByCard, payByCredit, payByCertificate);

            Assert.IsTrue(Res, MessageError);
        }
コード例 #5
0
        public void CloseWithoutPosition()
        {
            double cash             = 100;
            double payByCard        = 0;
            double payByCredit      = 0;
            double payByCertificate = 0;
            int    checkNumber;
            int    sessionMnumber;

            Res = Fr.ОткрытьЧек(ИДУстойства: Device,
                                ФискальныйЧек: true,
                                ЧекВозврата: false,
                                АнулироватьОткрытыйЧек: false,
                                НомерЧека: out checkNumber,
                                НомерСмены: out sessionMnumber);
            Assert.IsTrue(Res, MessageError);

            Res = Fr.ЗакрытьЧек(Device, cash, payByCard, payByCredit, payByCertificate);

            Assert.IsFalse(Res);
            var error = "Пустой чек";

            Assert.IsTrue(MessageError.Contains(error));
        }