コード例 #1
0
 public void UpdateStock(Product product)
 {
     if (product.StockLevel > 0)
     {
         _pusher.Trigger(String.Format("product-{0}", product.Id), "StockUpdated", product);
     }
 }
コード例 #2
0
        public void Product_Unavailable_ReturnOutOfStock()
        {
            //Arrange
            _product = new Product()
            {
                StockLevel = 0
            };

            //Act

            //Assert
            Assert.AreEqual(_product.StockStatus, "Out of Stock");
        }
コード例 #3
0
        public void Product_Available_ReturnInStock()
        {
            //Arrange
            _product = new Product()
            {
                StockLevel = 1
            };

            //Act

            //Assert
            Assert.AreEqual(_product.StockStatus, "In Stock");
        }
コード例 #4
0
 public void CreateProduct(Product product)
 {
     _documentSession.Store(product);
 }
コード例 #5
0
        public void Init()
        {
            _availableProduct = new Product
            {
                Description = "UpdateStock_AvailableProduct_CallsPusher description",
                Id = "1",
                StockLevel = 10,
                Title = "UpdateStock_AvailableProduct_CallsPusher Title"
            };

            _unavailableProduct = new Product
            {
                Description = "UpdateStock_AvailableProduct_CallsPusher description",
                Id = "1",
                StockLevel = 0,
                Title = "UpdateStock_AvailableProduct_CallsPusher Title"
            };

            _productRepositoryMock = new Mock<IProductRepository>();

            AutomapperConfig.RegisterMappings();
        }
コード例 #6
0
 public void Dispose()
 {
     _availableProduct = null;
     _unavailableProduct = null;
     _productRepositoryMock = null;
 }
コード例 #7
0
        public void Init()
        {
            _product = new Product
            {
                Description = "Product_Available_ReturnInStock description",
                Id = "1",
                StockLevel = 10,
                Title = "Product_Available_ReturnInStock Title"
            };

            _documentSessionMock = new Mock<IDocumentSession>();
        }
コード例 #8
0
 public void Dispose()
 {
     _product = null;
 }
コード例 #9
0
 public void CreateProduct(Product product)
 {
     _productRepository.CreateProduct(product);
 }
コード例 #10
0
 public void Dispose()
 {
     _availableProduct = null;
     _pusherMock = null;
     _pusherProviderMock = null;
 }