?????????????????????Ч????ID??????????????????Ч????

    [TestMethod] 
    public void GetProductWithInValidIDThrowsException() 
    { 
        // Arrange 
        IProductRepository productRepository = new StubNullProductRepository(); 
        ProductService productService = new ProductService(productRepository); 
        
        // Act & Assert 
        Assert.Throws<ProductNotFoundException>(() => productService.GetByID("invalid-id")); 
    } 
        
    public class StubNullProductRepository : IProductRepository 
    { 
        public Product GetByID(string id) 
        { 
            return null; 
        } 
        
        public IEnumerable<Product> GetProducts() 
        { 
            throw new NotImplementedException(); 
        } 
    }

??????????????У???????????????????????????Repository????????????????Repository?????????????????磺

    public class StubProductRepository : IProductRepository  
    {  
        public Product GetByID(string id)  
        {  
            if (id == "spr-product")  
            {  
                return new Product()  
                {  
                    ID = "spr-product"??  
                    Name = "Nice Product"
                };  
            }  
        
            return null;  
        }  
        
        public IEnumerable<Product> GetProducts()  
        {  
            throw new NotImplementedException();  
        }  
    }

???????????????????д???????????IProductRepository?????????????????????????????????Щ????????????????Щ????з???????????????????????????????????????????????????????????????????????????????????????????????