コード例 #1
0
        public void TakeOne_NotAvaliable_ExceptionThrown()
        {
            var info = new Product(Guid.NewGuid(), "Cookie", 10);
            var amount = 0;
            var instance = new ProductCollection(info, amount);

            var taken = instance.TakeOne();
        }
コード例 #2
0
        public void IsAvaliableProperty_ZeroAmount_FalseReturned()
        {
            var info = new Product(Guid.NewGuid(), "Cookie", 10);
            var amount = 0;

            var instance = new ProductCollection(info, amount);

            Assert.IsFalse(instance.IsAvaliable);
        }
コード例 #3
0
        public void Constructor_ValidArguments_InstanceCreated()
        {
            var info = new Product(Guid.NewGuid(), "Cookie", 10);
            var amount = 10;

            var instance = new ProductCollection(info, amount);

            Assert.AreEqual(instance.ProductInfo, info);
            Assert.AreEqual(instance.Amount, amount);
        }
コード例 #4
0
        public void TakeOne_IsAvaliable_ProductReturned()
        {
            var info = new Product(Guid.NewGuid(), "Cookie", 10);
            var amount = 10;
            var instance = new ProductCollection(info, amount);

            var taken = instance.TakeOne();

            Assert.AreEqual(info.Barcode, taken.Barcode);
            Assert.AreEqual(info.Name, taken.Name);
            Assert.AreEqual(info.Price, taken.Price);
        }