Пример #1
0
        public void Create2BarCodesTest()
        {
            var barCode1 = _factory.CreateBarCode(SilpoZefir, true, 6, 99L);
            var barCode2 = _factory.CreateBarCode(BarCode2, false, 0, 99L);

            _storage.CreateBarCode(barCode1);
            _storage.CreateBarCode(barCode2);

            var newBarCode = _storage.GetAllBarCodes().FirstOrDefault();

            Assert.IsNotNull(newBarCode);
            Assert.AreEqual(1, _storage.GetAllBarCodes().Count());
            Assert.AreEqual(barCode2.Code, newBarCode.Code);
            Assert.AreEqual(barCode2.IsWeight, newBarCode.IsWeight);
            Assert.AreEqual(99L, newBarCode.Id);
        }
Пример #2
0
        private IBarCode CreateBarCode(string code, bool isWeight = false, int numberOfDigits = 0)
        {
            var factory = new BarCodeFactory();

            return(factory.CreateBarCode(code, isWeight, numberOfDigits));
        }