コード例 #1
0
        public void ProductCatalog_Should_Return_False_For_External_Insert()
        {
            Product prod = new Product {
                id = 3, Catagories = "Vehicle", productId = "cars01s", brandName = "Maruti", productName = "Suzuki", subCatagories = "Cars"
            };

            _moqRepository.Setup(x => x.AddExternalService(prod)).Returns(false);

            var moqobj = _moqRepository.Object;

            IAddExternalService   products = moqobj;
            IRepository <Product> product  = new Repository(moqobj);
            bool actualResult = product.AddExternalService(prod);

            Assert.AreEqual(false, actualResult);
        }
コード例 #2
0
 public PriceRepository(IAddExternalService service)
 {
     this.addService = service;
 }